Registry / serialization / mdformat-footnote

mdformat-footnote

JSON →
library0.1.3pypypiunverified

mdformat-footnote is a plugin for the opinionated Markdown formatter `mdformat`. It extends `mdformat` to properly parse, validate, and format Pandoc-style footnotes, ensuring consistent styling within Markdown documents. The current version is 0.1.3, and releases are tied to supporting new `mdformat` versions or addressing specific formatting issues.

pip install mdformat mdformat-footnote
INSTALL
IMPORT
SIG · MDFORMAT-FOOTNOTE
M
mdformat-footnote
serializationpythonv0.1.3
Install
1.9s avg
Import
111ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.114s · 20MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.9s · import 0.108s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

mdformat
import mdformat # No direct import for mdformat_footnote's plugin module is typically needed for userland code, as mdformat loads it.
from mdformat_footnote import FootnotePlugin
mdformat-footnote is loaded by mdformat as an extension, not typically imported directly in application code. You enable it via mdformat's 'extensions' argument or CLI flag.

To use `mdformat-footnote`, you need to install both `mdformat` and `mdformat-footnote`. Then, when using `mdformat` (either via the Python API or CLI), you must explicitly enable the 'footnote' extension.

import mdformat markdown_with_footnotes = ( """ Here is a footnote reference.[^1] And here's a longer one.[^bignote] [^1]: This is the first footnote. [^bignote]: Here's one with multiple paragraphs and code. Subsequent paragraphs are indented to show that they belong to the previous footnote. """ ) # Using the Python API to format with the footnote extension formatted_markdown = mdformat.text(markdown_with_footnotes, extensions={'footnote'}) print("--- Original ---") print(markdown_with_footnotes) print("\n--- Formatted ---") print(formatted_markdown) # To use via CLI (assuming mdformat and mdformat-footnote are installed): # Save the above markdown to a file, e.g., 'input.md' # Then run: mdformat --extensions footnote input.md
Debug
Known issues
breakingmdformat-footnote v0.1.2 upgraded to support mdformat v1 and Python >=3.10. Older versions of mdformat-footnote will not work with mdformat v1+ or Python versions below 3.10.
fix
Upgrade mdformat-footnote to 0.1.2 or later: `pip install --upgrade mdformat-footnote`. Ensure your Python environment is 3.10 or newer.
affects: <0.1.2
gotchamdformat is a CommonMark formatter. Without the `mdformat-footnote` plugin enabled, any footnote syntax will be treated as non-CommonMark and may be backslash-escaped or otherwise incorrectly handled, leading to a loss of intended Markdown structure.
fix
Always enable the 'footnote' extension when you intend to format documents containing footnotes, either via the CLI (`mdformat --extensions footnote your_file.md`) or Python API (`mdformat.text(..., extensions={'footnote'})`).
affects: all
gotchaThe `mdformat` core documentation recommends pinning `mdformat` dependency versions because its formatting style may change in each version. This also applies to `mdformat-footnote` and could lead to unexpected reformatting.
fix
Pin your `mdformat` and `mdformat-footnote` versions in your `requirements.txt` or `pyproject.toml` (e.g., `mdformat==1.0.0`, `mdformat-footnote==0.1.3`) to ensure consistent formatting across runs and environments.
affects: all
Upgrade
Version history
0.1.3latest on PyPI · released Jan 30, 2026
Audit
Dependencies
mdformatrequiredCore formatter; mdformat-footnote is a plugin for it.
pythonrequiredRequires Python >=3.10
Agent activity
7 hits · last 30 days
node
6
Resources
mdformat-footnote — pip install mdformat-footnote · libregistry