Skip to content

Commit f82a345

Browse files
authored
Documentation
* Updated images documentation to include pymdownx.blocks.caption extension * put back HTML figure in image caption docs * fix typo in image captions
1 parent 4918a10 commit f82a345

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

docs/reference/images.md

+13
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@ following lines to `mkdocs.yml`:
1919
markdown_extensions:
2020
- attr_list
2121
- md_in_html
22+
- pymdownx.blocks.caption
2223
```
2324
2425
See additional configuration options:
2526
2627
- [Attribute Lists]
2728
- [Markdown in HTML]
29+
- [Caption]
2830
2931
[Attribute Lists]: ../setup/extensions/python-markdown.md#attribute-lists
3032
[Markdown in HTML]: ../setup/extensions/python-markdown.md#markdown-in-html
33+
[Caption]: ../setup/extensions/python-markdown-extensions.md#caption
3134
3235
### Lightbox
3336
@@ -135,6 +138,16 @@ but it's always possible to use the [Markdown in HTML] extension with literal
135138
</figure>
136139
</div>
137140

141+
However, [Caption] provides an alternative syntax to add captions
142+
to any Markdown block element, including images:
143+
144+
``` markdown title="Image with caption"
145+
![Image title](https://dummyimage.com/600x400/){ width="300" }
146+
/// caption
147+
Image caption
148+
///
149+
```
150+
138151
### Image lazy-loading
139152

140153
Modern browsers provide [native support for lazy-loading images][lazy-loading]

docs/setup/extensions/python-markdown-extensions.md

+19
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,25 @@ documentation][BetterEm] for more information.
110110
111111
[BetterEm]: https://facelessuser.github.io/pymdown-extensions/extensions/betterem/
112112
113+
### Caption
114+
115+
<!-- md:version 1.0.0 -->
116+
<!-- md:extension [pymdownx.blocks.caption][Caption] -->
117+
118+
The [Caption] extension adds the ability to add captions to any Markdown block,
119+
including images, tables, and code blocks. Enable it via `mkdocs.yml`:
120+
121+
``` yaml
122+
markdown_extensions:
123+
- pymdownx.blocks.caption
124+
```
125+
126+
The configuration options of this extension are not specific to Material for
127+
MkDocs, as they only impact the Markdown parsing stage. See the [Caption
128+
documentation][Caption] for more information.
129+
130+
[Caption]: https://facelessuser.github.io/pymdown-extensions/extensions/blocks/plugins/caption/
131+
113132
### Caret, Mark & Tilde
114133
115134
<!-- md:version 1.0.0 -->

0 commit comments

Comments
 (0)