Turn markdown images into captioned images using <figure>
Project description
markdown-captions
Converts images with alt text to <figure> with <figcaption>.
Works with attr_list extension.
Usage
pip install markdown-captions
md = markdown.Markdown(extensions=['markdown_captions'])
Examples
simple example


<p>
<figure><img src="img.jpg" /><figcaption>caption</figcaption></figure>
<figure><img src="img2.jpg" /><figcaption>caption2</figcaption></figure>
</p>
image class and title
{: .class1 }
<figure class="class1"><img src="img.jpg" title="title" /><figcaption>caption</figcaption></figure>
inline captioned images
<style>
.inline {
display: inline-block;
}
</style>
{: .inline }
{: .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 src="img.jpg" />
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
markdown-captions-1.tar.gz
(2.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file markdown-captions-1.tar.gz.
File metadata
- Download URL: markdown-captions-1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b19bebfcc0911a07f09b82ec5fb1f088d84b27eb09e1b5795642c80e224eb27
|
|
| MD5 |
c7ed0293666941c06f9c733e1a843845
|
|
| BLAKE2b-256 |
872a342d5dfd3db7c93e66b588fda33ca2c42a56e03e0df1e3c7c14f264f1d4d
|
File details
Details for the file markdown_captions-1-py3-none-any.whl.
File metadata
- Download URL: markdown_captions-1-py3-none-any.whl
- Upload date:
- Size: 2.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbbb4bef5be950aac99c3cf84d689d4b5b76f843bd670972ae4b0fe8b7cb60d6
|
|
| MD5 |
672fdfb8e14e709941df7258ffc28351
|
|
| BLAKE2b-256 |
0d06049a6cb64713debc1a4cef75e49407f96476e976a515dbe4afcd346e91ff
|