Turn markdown images into captioned images using <figure>
Project description
markdown-captions
Converts images with alt text to <figure>
with <figcaption>
.
Usage
pip install markdown-captions
md = markdown.Markdown(
extensions=[
'markdown_captions',
'attr_list' # optional
]
)
Examples
simple example
![caption](img.jpg)
![caption2](img2.jpg)
<p>
<figure><img src="img.jpg" /><figcaption>caption</figcaption></figure>
<figure><img src="img2.jpg" /><figcaption>caption2</figcaption></figure>
</p>
image title and class (with attr_list extension)
![caption](img.jpg "title"){: .class1 }
<figure class="class1"><img src="img.jpg" title="title" /><figcaption>caption</figcaption></figure>
inline captioned images
<style>
.inline {
display: inline-block;
}
</style>
![caption](img.jpg){: .inline }
![caption2](img2.jpg){: .inline }
<p>
<figure class="inline"><img src="img.jpg" /><figcaption>caption</figcaption></figure>
<figure class="inline"><img src="img2.jpg" /><figcaption>caption2</figcaption></figure>
</p>
images with no alt text are not captioned
![](img.jpg)
<img src="img.jpg" />
referenced images, and shorthand references are also supported
![caption][ref]
![caption2]
[ref]: img.jpg
[caption2]: img2.jpg
'<p>
<figure><img src="img.jpg" /><figcaption>caption</figcaption></figure>
<figure><img src="img2.jpg" /><figcaption>caption2</figcaption></figure>
</p>'
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for markdown_captions-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67e785d6a288cf951e218e555026b9591e699c2572fab97b55fe833a477e1654 |
|
MD5 | b5f35af2edb39646fc73ac7aec9c4f15 |
|
BLAKE2b-256 | 0c27e97d8a596f27e6b6f4538eb6ba16861fcc808ac8c395a873f4df55dc920e |