Skip to main content

Enhance your MkDocs documentation with easy figure, table captioning and numbering.

Project description

MkDocs Caption

Package PyPI - Version PyPI - Python Version
Meta Hatch project linting - Ruff code style - Black types - Mypy License - MIT
CI

Enhance your MkDocs documentation with easy figure, table captioning and numbering.

Features

  • Table and Figure captioning and numbering
  • Automatic link text generation for references
  • Highly configurable
  • Extensible to support captions for all Element types


Background

I developed mkdocs-caption when I switched from Antora (AsciiDoc) to MkDocs and was missing a native and comprehensive figure and table caption system.

mkdocs-caption uses many ideas and markdown syntax from flywire/caption, which itself is a fork of yafg - yet another figure generator plugin for Python's Markdown. Although initially developed separately and not sharing any code, I was made aware of flywire/caption, and it's worth crediting it here.


Documentation

For full documentation, visit https://tobiasah.github.io/mkdocs-caption/.

Installation

pip install mkdocs-caption

Quick Usage

In mkdocs.yml:

...
plugins:
- caption

Inside the Markdown, the following will now be converted into a figure/table with caption and numbering.

![figure caption](img.jpg)

Table: table caption

| heading 1| heading 2 | 
| - | - | 
| content 1 | content 2 |
| content 3 | content 4 | 
<p>
  <figure id=_figure-1>
    <img src="img.jpg" />
    <figcaption>Figure 1. figure caption</figcaption>
  </figure>
</p>
<p>
<table id="_table_1">
  <thead>
    <tr>
      <th>heading 1</th>
      <th>heading 2</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>content 1</td>
      <td>content 2</td>
    </tr>
    <tr>
      <td>content 3</td>
      <td>content 4</td>
    </tr>
  </tbody>
  <caption>Table 1: table caption</caption>
</table>

License

mkdocs-caption is distributed under the terms of the MIT license.

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_caption-1.2.0.tar.gz (191.0 kB view details)

Uploaded Source

Built Distribution

mkdocs_caption-1.2.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_caption-1.2.0.tar.gz.

File metadata

  • Download URL: mkdocs_caption-1.2.0.tar.gz
  • Upload date:
  • Size: 191.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for mkdocs_caption-1.2.0.tar.gz
Algorithm Hash digest
SHA256 842fd647c8e7c1cdecc0f822f4d597885975e3f4c4b87276025d49d21d2a8698
MD5 b77c8c29b4b64e17a1829e4efa99c306
BLAKE2b-256 0d714792ab0c17986616e9e43d2ebe3726876033b4be8c8d3cf7fd4ac6dfc64c

See more details on using hashes here.

File details

Details for the file mkdocs_caption-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_caption-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 debe9184e6c5d396f03c3fbd06e60dedcb48ca8fe6ae695169e719b6cb67e89a
MD5 752461f5e7264573b53d4c7baf897faf
BLAKE2b-256 e52465399352fb47c054d78419aee08e62a1532721b13075476a0df5a6a13dc0

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