Skip to main content

MkDocs plugin that added captions to images by converting markdown encoded images into <figure> elements.

Project description

MkDocs ImageCaptions Plugin

Plugin for MkDocs that converts markdown encoded images to HTML

element with captions.

Example

Input MD Template:

![Informative image caption](/docs/assets/images/image.png)

Output:

<figure class="figure-image">
  <img src="/docs/assets/images/image.png" alt="Informative image caption">
  <figcaption>Informative image caption</figcaption>
</figure>

Plugin installation

To enable the plugin, add the following line to your mkdocs config file mkdocs.yml:

plugins:
    - mkdocs-image-captions

Local development

Dependencies installation

The package requires Python >= 3.8 and Poetry >= 1.4.0.

Project installation

Install required packages

poetry install

Now you can activate Poetry and make your changes:

poetry shell

Run tests

Activate virtualenv:

poetry shell

Run tests:

python tests/test_plugin.py

Update package on PyPI with poetry

Build new package version

poetry build

Push to PyPI

poetry publish

Note: to push packages into PyPI you need to provide auth token:

export POETRY_PYPI_TOKEN_PYPI=<your token>

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_image_captions-0.2.2.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_image_captions-0.2.2-py3-none-any.whl (4.0 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