Skip to main content

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: inline-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>

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

markdown_image_caption-0.3.0-py3-none-any.whl (2.9 kB view hashes)

Uploaded Python 3

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