Skip to content

Commit 840a00a

Browse files
committed
Improved discoverability of icons in the documentation
1 parent a919199 commit 840a00a

File tree

17 files changed

+184
-83
lines changed

17 files changed

+184
-83
lines changed

docs/reference/admonitions.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,16 @@ theme:
4949
<type>: <icon> # (1)!
5050
```
5151

52-
1. Set `<type`> to any of the [supported types] and `<icon>` to any valid icon
53-
shortcode, which you can find by using the [icon search].
52+
1. Enter a few keywords to find the perfect icon using our [icon search] and
53+
click on the shortcode to copy it to your clipboard:
54+
55+
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
56+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="alert" />
57+
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
58+
<div class="mdx-iconsearch-result__meta"></div>
59+
<ol class="mdx-iconsearch-result__list"></ol>
60+
</div>
61+
</div>
5462

5563
??? example "Expand to show alternate icon sets"
5664

docs/reference/buttons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ CSS class selectors.
6969
### Adding icon buttons
7070

7171
Of course, icons can be added to all types of buttons by using the [icon syntax]
72-
together with any valid icon shortcode, which can be easily found with a few keystrokes through the [icon search].
72+
together with any valid icon shortcode, which can be easily found with a few keystrokes through our [icon search].
7373

7474
``` markdown title="Button with icon"
7575
[Send :fontawesome-solid-paper-plane:](#){ .md-button }

docs/reference/icons-emojis.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,21 @@ reference any icon that's [bundled with the theme][icon search] with Jinja's
198198

199199
``` html
200200
<span class="twemoji">
201-
{% include ".icons/fontawesome/brands/twitter.svg" %}
201+
{% include ".icons/fontawesome/brands/twitter.svg" %} <!-- (1)! -->
202202
</span>
203203
```
204204

205+
1. Enter a few keywords to find the perfect icon using our [icon search] and
206+
click on the shortcode to copy it to your clipboard:
207+
208+
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
209+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="brands twitter" />
210+
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
211+
<div class="mdx-iconsearch-result__meta"></div>
212+
<ol class="mdx-iconsearch-result__list"></ol>
213+
</div>
214+
</div>
215+
205216
This is exactly what Material for MkDocs does in its templates.
206217

207218
[extending the theme]: ../customization.md#extending-the-theme

docs/reference/index.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,16 @@ icon: material/emoticon-happy # (1)!
8888
...
8989
```
9090

91-
1. Check out the left sidebar to see icons in action! Also check out our
92-
[icon search] to find the perfect icon with a few keystrokes.
91+
1. Enter a few keywords to find the perfect icon using our [icon search] and
92+
click on the shortcode to copy it to your clipboard:
93+
94+
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
95+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="emoticon happy" />
96+
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
97+
<div class="mdx-iconsearch-result__meta"></div>
98+
<ol class="mdx-iconsearch-result__list"></ol>
99+
</div>
100+
</div>
93101

94102
[Insiders]: ../insiders/index.md
95103
[icon search]: icons-emojis.md#search

docs/setup/adding-a-git-repository.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,26 @@ repo_name: squidfunk/mkdocs-material
5656
[`fontawesome/brands/git-alt`][icon.repo default]
5757

5858
While the default repository icon is a generic git icon, it can be set to
59-
[any icon bundled with the theme][custom icons] by referencing a valid icon
60-
path in `mkdocs.yml`:
59+
any icon bundled with the theme by referencing a valid icon path in
60+
`mkdocs.yml`:
6161

6262
``` yaml
6363
theme:
6464
icon:
65-
repo: fontawesome/brands/git-alt
65+
repo: fontawesome/brands/git-alt # (1)
6666
```
6767

68+
1. Enter a few keywords to find the perfect icon using our [icon search] and
69+
click on the shortcode to copy it to your clipboard:
70+
71+
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
72+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="git" />
73+
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
74+
<div class="mdx-iconsearch-result__meta"></div>
75+
<ol class="mdx-iconsearch-result__list"></ol>
76+
</div>
77+
</div>
78+
6879
Some popular choices:
6980

7081
- :fontawesome-brands-git: – `fontawesome/brands/git`
@@ -80,7 +91,7 @@ Some popular choices:
8091

8192
[icon.repo support]: https://github.com/squidfunk/mkdocs-material/releases/tag/5.0.0
8293
[icon.repo default]: https://github.com/squidfunk/mkdocs-material/blob/master/material/.icons/fontawesome/brands/git-alt.svg
83-
[custom icons]: https://github.com/squidfunk/mkdocs-material/tree/master/material/.icons
94+
[icon search]: ../reference/icons-emojis.md#search
8495

8596
### Edit button
8697

docs/setup/changing-the-logo-and-icons.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,23 @@ Add the following lines to `mkdocs.yml`:
3434
``` yaml
3535
theme:
3636
icon:
37-
logo: material/library
37+
logo: material/library # (1)!
3838
```
3939

40+
1. Enter a few keywords to find the perfect icon using our [icon search] and
41+
click on the shortcode to copy it to your clipboard:
42+
43+
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
44+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="material library" />
45+
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
46+
<div class="mdx-iconsearch-result__meta"></div>
47+
<ol class="mdx-iconsearch-result__list"></ol>
48+
</div>
49+
</div>
50+
4051
[logo support]: https://github.com/squidfunk/mkdocs-material/releases/tag/0.1.0
4152
[logo default]: https://github.com/squidfunk/mkdocs-material/blob/master/material/.icons/material/library.svg
53+
[icon search]: ../reference/icons-emojis.md#search
4254

4355
Normally, the logo in the header and sidebar links to the homepage of the
4456
documentation, which is the same as `site_url`. This behavior can be changed

docs/setup/setting-up-the-footer.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,28 @@ with:
2525
``` yaml
2626
extra:
2727
social:
28-
- icon: fontawesome/brands/twitter
28+
- icon: fontawesome/brands/twitter # (1)!
2929
link: https://twitter.com/squidfunk
3030
```
3131
32+
1. Enter a few keywords to find the perfect icon using our [icon search] and
33+
click on the shortcode to copy it to your clipboard:
34+
35+
<div class="mdx-iconsearch" data-mdx-component="iconsearch">
36+
<input class="md-input md-input--stretch mdx-iconsearch__input" placeholder="Search icon" data-mdx-component="iconsearch-query" value="brands twitter" />
37+
<div class="mdx-iconsearch-result" data-mdx-component="iconsearch-result" data-mdx-mode="file">
38+
<div class="mdx-iconsearch-result__meta"></div>
39+
<ol class="mdx-iconsearch-result__list"></ol>
40+
</div>
41+
</div>
42+
3243
The following properties must be set for each link:
3344
3445
`icon`{ #social-icon }
3546

3647
: [:octicons-tag-24: 5.0.0][social.icon support] · :octicons-milestone-24:
3748
Default: _none_ · :octicons-alert-24: Required – This property must contain
38-
a valid path to [any icon bundled with the theme][custom icons], or the
49+
a valid path to any icon bundled with the theme, or the
3950
build will not succeed. Some popular choices:
4051

4152
* :fontawesome-brands-behance: – `fontawesome/brands/behance`
@@ -91,7 +102,6 @@ The following properties must be set for each link:
91102
[social support]: https://github.com/squidfunk/mkdocs-material/releases/tag/1.0.0
92103
[social.icon support]: https://github.com/squidfunk/mkdocs-material/releases/tag/5.0.0
93104
[social.name support]: https://github.com/squidfunk/mkdocs-material/releases/tag/5.1.5
94-
[custom icons]: https://github.com/squidfunk/mkdocs-material/tree/master/material/.icons
95105

96106
### Copyright notice
97107

material/overrides/assets/javascripts/bundle.7e64518f.min.js

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/overrides/assets/javascripts/bundle.de8129cf.min.js.map renamed to material/overrides/assets/javascripts/bundle.7e64518f.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

material/overrides/assets/javascripts/bundle.de8129cf.min.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)