Skip to main content

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.

Metadata

Release files for mkdocs-caption 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mkdocs-caption 1.3.0
File Size Uploaded
mkdocs_caption-1.3.0.tar.gz 192.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mkdocs-caption 1.3.0
File Interpreter ABI Platform
mkdocs_caption-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 209.9 kB

Release files / mkdocs_caption-1.3.0.tar.gz

Download URL mkdocs_caption-1.3.0.tar.gz
Size 192.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ed82481616d27b86d3ae275cc89241ce37b9702ff2d4ed1b02e4fe751ad3ecc3
BLAKE2b-256 checksum
How to use checksums
1f5a1e80f7d88aba0bfb1f376a683181b52bf32b2f864742a8efb75afc61335c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / mkdocs_caption-1.3.0-py3-none-any.whl

Download URL mkdocs_caption-1.3.0-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ff984ff9fb20f820d880bf68aeff7fe81ecffc42e9fb9b2ca6bb486a7dd8f96
BLAKE2b-256 checksum
How to use checksums
b62100cbc509a601866e0f13f50c69a114dfe638d63dafeff1d604205884d331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page