Skip to main content

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

![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 class and title

![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" />

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)

Uploaded Source

Built Distribution

markdown_captions-1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

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

Hashes for markdown-captions-1.tar.gz
Algorithm Hash digest
SHA256 4b19bebfcc0911a07f09b82ec5fb1f088d84b27eb09e1b5795642c80e224eb27
MD5 c7ed0293666941c06f9c733e1a843845
BLAKE2b-256 872a342d5dfd3db7c93e66b588fda33ca2c42a56e03e0df1e3c7c14f264f1d4d

See more details on using hashes here.

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

Hashes for markdown_captions-1-py3-none-any.whl
Algorithm Hash digest
SHA256 fbbb4bef5be950aac99c3cf84d689d4b5b76f843bd670972ae4b0fe8b7cb60d6
MD5 672fdfb8e14e709941df7258ffc28351
BLAKE2b-256 0d06049a6cb64713debc1a4cef75e49407f96476e976a515dbe4afcd346e91ff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page