Image caption support for Python Markdown
Project description
Markdown Image caption.
Inspired by the probably un-maintained package mdx_figcap
Usage:
Make sure you have markdown installed.
Define an image with caption in your markdown.
![alttext](http://example.com/image.png "caption")
This will be converted to:
<span class="img_container center" style="display: block;">
<img alt="test" src="http://example.com/image.png" style="display:block; margin-left: auto; margin-right: auto;" title="caption" />
<span class="img_caption" style="display: block; text-align: center;">caption</span>
</span>
<figure>
<img alt="alttext" src="http://example.com/image.png" title="caption" />
<figcaption>caption</figcaption>
</figure>
Why no figure tag implementation ?
The figure tag is a block level element. The image element is an inline element. This difference breaks the attribute extension.
So ![alttext](http://example.com/image.png "caption"){: .center}
would not work if a figure was used.
Installation
pip install markdown-image-caption
add the plugin to your markdown
import markdown
parser = markdown.Markdown(extensions=["markdown_image_caption.plugin"])
Project details
Release history Release notifications | RSS feed
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-image-caption-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 768fdb721c54cf14b6552bef30f4d231b8fea99e0f7959d7152348489c395915 |
|
MD5 | fd6373d8e6fa1ca5111456f4d6957373 |
|
BLAKE2b-256 | ac5a9b64f10c57197e7146afe12a1142ed77f78d56e157a48edc93fc2d1d1cf1 |
Close
Hashes for markdown_image_caption-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b509f342961f31cce03555fa42cc6738f88600f64a74937d9e11512a495b0f0e |
|
MD5 | d20ca194d3dc5d2800ca0201e17d2b44 |
|
BLAKE2b-256 | f731a2d283157fd709534b08181cb053e473b38c4b836b7e58b0d92cfd39304c |