From 0e6bb474a879a01a9a5d0dd6984d2f2a13af1c51 Mon Sep 17 00:00:00 2001 From: Devon Rueckner Date: Tue, 17 Nov 2020 12:33:16 -0800 Subject: [PATCH] add documentation about using icons in rst --- docs/pages/icons/index.vue | 29 +++++++++++++++++++++++++++++ nuxt.config.js | 5 +++++ 2 files changed, 34 insertions(+) diff --git a/docs/pages/icons/index.vue b/docs/pages/icons/index.vue index ab8d57ad7..1dfd5e3d3 100644 --- a/docs/pages/icons/index.vue +++ b/docs/pages/icons/index.vue @@ -80,6 +80,19 @@

If the default Material icon library and/or community-contributed libraries are insufficient, use to create a new one.

+ +

+ For use in documentation such as the , all icons above have available in reStructuredText replacement syntax below: +

+ +

+ Copy and paste it into a file such as rstIconReplacements.txt and then add it to your conf.py file . +

+

+ Then in *.rst files you can use, for example, |video| to insert the video icon. Note that these icons will not have screen-reader-accessible labels associated with them, so they should always be accompanied by descriptive text. +

+
+ @@ -87,12 +100,18 @@ @@ -105,4 +124,14 @@ fill: blue !important; } + .replacements { + display: block; + width: 100%; + height: 100px; + font-size: smaller; + white-space: pre; + border: 1px solid #dedede; + border-radius: 4px; + } + diff --git a/nuxt.config.js b/nuxt.config.js index 3d9d1a3c6..43feb466c 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -42,6 +42,11 @@ export default { loader: 'svg-icon-inline-loader', exclude: /node_modules/, }); + // allow this file to be displayed + config.module.rules.push({ + test: /rstIconReplacements.txt/, + loader: 'raw-loader', + }); config.devtool = 'source-map'; }, cssSourceMap: true,