This is the extension mdx_figures
for Python-Markdown
to make captioned figures out of images that are followed by a description.
In contrast to other extensions with that purpose, this one
- does not introduce new syntax tokens,
- does not change the block/inline category of the
![]
element - does not repurpose existing image attributes like
alt
ortitle
, - allows use of Markdown in the caption,
- is most natural to write, thus fitting the Markdown spirit very well.
Forked from lehni who forked from helderco. Added a cherry-pick from the fork by gijsdeheij.
![](http://lorempixel.com/350/150/)
: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Praesent at consequat magna, faucibus ornare eros. Nam et
mattis urna. Cras sodales, massa id gravida
Output:
<figure>
<img alt="" src="http://lorempixel.com/350/150/" />
<figcaption>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Praesent at consequat magna, faucibus ornare eros. Nam et
mattis urna. Cras sodales, massa id gravida</p>
</figcaption>
</figure>
Clone and run
sudo python setup.py install
For mkdocs
add this to your mkdocs.yml
file:
markdown_extensions:
- mdx_figures