Skip to main content

A MkDocs plugin that converts markdown encoded images surrounded by two asterisks or two underscores into <figure> elements.

Project description

MkDocs Em-Img2Fig Plugin

This MkDocs plugin converts markdown encoded images surrounded by two asterisks or two underscores like

*![An image caption](images/my-image.png)*

OR

_![An image caption](images/my-image.png)_

into <figure> notation with inline markdown for the image itself:

<figure markdown>
  ![Image caption](/images/my-image.png)
  <figcaption>Image caption</figcaption>
</figure>

Requirements

This package requires:

  • Python >=3.9 and MkDocs version 1.0 or higher.
  • md_in_html extension enabled in your MkDocs configuration.

Installation

Install the package with pip:

pip install mkdocs-em-img2fig-plugin

Enable the mkdocs-em-img2fig-plugin plugin and md_in_html extension in your mkdocs.yml:

plugins:
  - search
  - autolinks
  - em-img2fig
markdown_extensions:
  - md_in_html

Note: If you use autolinks or similar plugin declare em-img2fig after it, not before for correct precedence.

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

More information about plugins in the MkDocs documentation

Credits

This plugin is a fork of the https://github.com/stuebersystems/mkdocs-img2fig-plugin which does not require the two asterisks or two underscores

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

mkdocs_em_img2fig_plugin-0.3.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

mkdocs_em_img2fig_plugin-0.3.3-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_em_img2fig_plugin-0.3.3.tar.gz.

File metadata

File hashes

Hashes for mkdocs_em_img2fig_plugin-0.3.3.tar.gz
Algorithm Hash digest
SHA256 8780fa24d5f99b6e5c1649dff113b69c1c4eefdf40b2ccd19b6025334a3ec9af
MD5 a553ea9d22b9bb3f3c007f99e50b536c
BLAKE2b-256 c3c2b9fb25de4b8bba7c186a5bd2c6af8a3a4ac36b4e627a52c1d4765ab23dc2

See more details on using hashes here.

File details

Details for the file mkdocs_em_img2fig_plugin-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_em_img2fig_plugin-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d1e7c47a6dbee2256bbaade097194b3675a40bbd968331c604f39f328193ffcf
MD5 15eca75063d82805b9319288cdfba871
BLAKE2b-256 12ea6c9ffb768bdf67d76c5174a917fbc7b5d0a7cf3f5a117d97ef3b0acc0d7f

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