Skip to content

Commit d5d0e75

Browse files
committed
Prepare 8.2.14 release
1 parent 0bd8c94 commit d5d0e75

File tree

11 files changed

+178
-102
lines changed

11 files changed

+178
-102
lines changed

CHANGELOG

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
mkdocs-material-8.2.14+insiders-4.15.0 (2022-05-08)
2+
3+
* Added support for improved tooltips
4+
5+
mkdocs-material-8.2.14 (2022-05-08)
6+
7+
* Fixed missing top right rounded border on admonition
8+
* Fixed #3886: 4xx status codes not handled when using instant loading
9+
110
mkdocs-material-8.2.13+insiders-4.14.0 (2022-05-05)
211

312
* Added Chinese language support to built-in search plugin

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Material for MkDocs can be installed with `pip`:
147147
pip install mkdocs-material
148148
```
149149

150-
Add the following line to `mkdocs.yml`:
150+
Add the following lines to `mkdocs.yml`:
151151

152152
``` yaml
153153
theme:

docs/reference/abbreviations.md

-86
This file was deleted.

docs/reference/mathjax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
template: overrides/main.html
3-
icon: material/alphabet-greek
3+
icon: material/math-integral
44
---
55

66
# MathJax

docs/reference/tooltips.md

+144
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
---
2+
template: overrides/main.html
3+
icon: material/comment-processing-outline
4+
---
5+
6+
# Tooltips
7+
8+
Material for MkDocs makes it trivial to add tooltips to links, abbreviations
9+
and all other elements, which allows for implementing glossary-like
10+
functionality, as well as small hints that are shown when the user hovers or
11+
focuses an element.
12+
13+
## Configuration
14+
15+
This configuration enables support for tooltips and abbreviations and allows to
16+
build a simple glossary, sourcing definitions from a central location. Add the
17+
following lines to `mkdocs.yml`:
18+
19+
``` yaml
20+
markdown_extensions:
21+
- abbr
22+
- pymdownx.snippets
23+
```
24+
25+
See additional configuration options:
26+
27+
- [Abbreviations]
28+
- [Snippets]
29+
30+
[Abbreviations]: ../setup/extensions/python-markdown.md#abbreviations
31+
[Snippets]: ../setup/extensions/python-markdown-extensions.md#snippets
32+
33+
### Improved tooltips
34+
35+
[:octicons-heart-fill-24:{ .mdx-heart } Sponsors only][Insiders]{ .mdx-insiders } ·
36+
[:octicons-tag-24: insiders-4.15.0][Insiders] ·
37+
:octicons-beaker-24: Experimental
38+
39+
When improved tooltips are enabled, Material for MkDocs replaces the browser's
40+
rendering logic for `title` attribute with beautiful little tooltips.
41+
Add the following lines to `mkdocs.yml`:
42+
43+
``` yaml
44+
theme:
45+
features:
46+
- content.tooltips
47+
```
48+
49+
Now, tooltips will be rendered for the following elements:
50+
51+
- __Content__ – elements with a `title`, permalinks and copy-to-clipboard button
52+
- __Header__ – home button, header title, color palette switch and repository link
53+
- __Navigation__ – links that are shortened with ellipsis, i.e. `...`
54+
55+
[Insiders]: ../insiders/index.md
56+
57+
## Usage
58+
59+
### Adding tooltips
60+
61+
The [Markdown syntax] allows to specify a `title` for each link, which will
62+
render as a beautiful tooltip when [improved tooltips] are enabled. Add a
63+
tooltip to an link with the following lines:
64+
65+
``` markdown title="Link with title, inline syntax"
66+
[Hover me](https://example.com "I'm a tooltip!")
67+
```
68+
69+
<div class="result" markdown>
70+
71+
[Hover me](https://example.com "I'm a tooltip!")
72+
73+
</div>
74+
75+
Tooltips can also be added to link references:
76+
77+
``` markdown title="Link with title, reference syntax"
78+
[Hover me][example]
79+
80+
[example]: https://example.com "I'm a tooltip!"
81+
```
82+
83+
<div class="result" markdown>
84+
85+
[Hover me](https://example.com "I'm a tooltip!")
86+
87+
</div>
88+
89+
[Markdown syntax]: https://daringfireball.net/projects/markdown/syntax#link
90+
[improved tooltips]: #improved-tooltips
91+
92+
### Adding abbreviations
93+
94+
Abbreviations can be defined by using a special syntax similar to [links] and
95+
[footnotes], starting with a `*` and immediately followed by the term or
96+
acronym to be associated in square brackets:
97+
98+
``` markdown title="Text with abbreviations"
99+
The HTML specification is maintained by the W3C.
100+
101+
*[HTML]: Hyper Text Markup Language
102+
*[W3C]: World Wide Web Consortium
103+
```
104+
105+
<div class="result" markdown>
106+
107+
The HTML specification is maintained by the W3C.
108+
109+
*[HTML]: Hyper Text Markup Language
110+
*[W3C]: World Wide Web Consortium
111+
112+
</div>
113+
114+
[links]: #adding-tooltips
115+
[footnotes]: footnotes.md
116+
117+
### Adding a glossary
118+
119+
The [Snippets] extension can be used to implement a simple glossary by moving
120+
all abbreviations in a dedicated file[^1], and embedding it with the
121+
[`--8<--` notation][Snippets notation] at the end of each document:
122+
123+
[^1]:
124+
It's highly recommended to put the Markdown file containing the
125+
abbreviations outside of the `docs` folder (here, a folder with the name
126+
`includes` is used), as MkDocs might otherwise complain about an
127+
unreferenced file.
128+
129+
=== ":octicons-file-code-16: docs/example.md"
130+
131+
```` markdown
132+
The HTML specification is maintained by the W3C.
133+
134+
--8<-- "includes/abbreviations.md"
135+
````
136+
137+
=== ":octicons-file-code-16: includes/abbreviations.md"
138+
139+
```` markdown
140+
*[HTML]: Hyper Text Markup Language
141+
*[W3C]: World Wide Web Consortium
142+
````
143+
144+
[Snippets notation]: https://facelessuser.github.io/pymdown-extensions/extensions/snippets/#snippets-notation

docs/schema/theme.json

+7
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,13 @@
557557
"content.tabs.link"
558558
]
559559
},
560+
{
561+
"title": "Improved tooltips",
562+
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/reference/tooltips/#improved-tooltips",
563+
"enum": [
564+
"content.tooltips"
565+
]
566+
},
560567
{
561568
"title": "Header hides automatically when scrolling",
562569
"markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-header/#automatic-hiding",

docs/setup/changing-the-colors.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ theme:
179179
palette: # (1)!
180180
- scheme: default
181181
toggle:
182-
icon: material/toggle-switch-off-outline # (2)!
182+
icon: material/toggle-switch # (2)!
183183
name: Switch to dark mode
184184
- scheme: slate # (3)!
185185
toggle:
186-
icon: material/toggle-switch
186+
icon: material/toggle-switch-off-outline
187187
name: Switch to light mode
188188
```
189189

@@ -214,11 +214,11 @@ The following properties must be set for each toggle:
214214
This property must point to a valid icon path referencing any icon bundled
215215
with the theme, or the build will not succeed. Some popular combinations:
216216

217-
* :material-toggle-switch-off-outline: + :material-toggle-switch: – `material/toggle-switch-off-outline` + `material/toggle-switch`
218-
* :material-weather-sunny: + :material-weather-night: – `material/weather-sunny` + `material/weather-night`
219-
* :material-eye-outline: + :material-eye: – `material/eye-outline` + `material/eye`
220-
* :material-lightbulb-outline: + :material-lightbulb: – `material/lightbulb-outline` + `material/lightbulb`
221-
* :material-brightness-4: + :material-brightness-7: – `material/brightness-4` + `material/brightness-7`
217+
* :material-toggle-switch: + :material-toggle-switch-off-outline: – `material/toggle-switch` + `material/toggle-switch-off-outline`
218+
* :material-weather-night: + :material-weather-sunny: – `material/weather-night` + `material/weather-sunny`
219+
* :material-eye: + :material-eye-outline: – `material/eye` + `material/eye-outline`
220+
* :material-lightbulb: + :material-lightbulb-outline: – `material/lightbulb` + `material/lightbulb-outline`
221+
* :material-brightness-7: + :material-brightness-4: – `material/brightness-7` + `material/brightness-4`
222222

223223
`name`{ #toggle-name }
224224

material/base.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<link rel="canonical" href="{{ page.canonical_url }}">
2323
{% endif %}
2424
<link rel="icon" href="{{ config.theme.favicon | url }}">
25-
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-8.2.13">
25+
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-8.2.14">
2626
{% endblock %}
2727
{% block htmltitle %}
2828
{% if page and page.meta and page.meta.title %}

mkdocs.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ theme:
5151
features:
5252
- content.code.annotate
5353
# - content.tabs.link
54+
- content.tooltips
5455
# - header.autohide
5556
# - navigation.expand
5657
- navigation.indexes
@@ -73,8 +74,8 @@ theme:
7374
icon: material/toggle-switch
7475
name: Switch to dark mode
7576
- scheme: slate
76-
primary: red
77-
accent: red
77+
primary: indigo
78+
accent: indigo
7879
toggle:
7980
icon: material/toggle-switch-off-outline
8081
name: Switch to light mode
@@ -92,6 +93,7 @@ plugins:
9293
redirect_maps:
9394
changelog/insiders.md: insiders/changelog.md
9495
conventions.md: philosophy.md
96+
reference/abbreviations.md: reference/tooltips.md
9597
reference/meta-tags.md: reference/index.md
9698
reference/variables.md: https://mkdocs-macros-plugin.readthedocs.io/
9799
sponsorship.md: insiders/index.md
@@ -195,7 +197,6 @@ nav:
195197
- Python Markdown Extensions: setup/extensions/python-markdown-extensions.md
196198
- Reference:
197199
- reference/index.md
198-
- Abbreviations: reference/abbreviations.md
199200
- Admonitions: reference/admonitions.md
200201
- Annotations: reference/annotations.md
201202
- Buttons: reference/buttons.md
@@ -210,6 +211,7 @@ nav:
210211
- Images: reference/images.md
211212
- Lists: reference/lists.md
212213
- MathJax: reference/mathjax.md
214+
- Tooltips: reference/tooltips.md
213215
- Insiders:
214216
- insiders/index.md
215217
- Getting started:

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mkdocs-material",
3-
"version": "8.2.13",
3+
"version": "8.2.14",
44
"description": "Documentation that simply works",
55
"keywords": [
66
"mkdocs",

0 commit comments

Comments
 (0)