mdformat-mkdocs
An mdformat plugin for mkdocs and Material for MkDocs
What it is and what it does
mdformat-mkdocs is a plugin for the mdformat Markdown formatter that adds awareness of MkDocs-specific and Material for MkDocs syntax. It standardizes Markdown formatting (four-space indents, dash-based unordered lists, single-digit ordered list markers by default) while preserving or actively formatting MkDocs extensions like admonitions, content tabs, definition lists, mkdocstrings injection blocks and cross-references, and math notation via dollarmath, texmath, and amsmath.
The plugin integrates seamlessly into any mdformat workflow—it auto-registers and requires no configuration. It handles both explicit formatting (admonitions with extra spacing for consistency with mkdocs styleguide, math block normalization) and implicit pass-through of PyMdown extensions like emoji, critic markup, and inline highlighting. It also supports optional extras for recommended companion formatters and provides flags like --no-mkdocs-math to disable math formatting and --ignore-missing-references to preserve ProgressBar syntax.
Use it for:
- Format documentation projects using MkDocs Material with consistent indentation and list styles across all Markdown files.
- Normalize admonitions, content tabs, and definition lists in Material for MkDocs docs while preserving their semantic meaning.
- Standardize math notation (LaTeX and dollar-sign blocks) in technical documentation built with MkDocs.
- Integrate into pre-commit hooks or CI pipelines to enforce Markdown style consistency for mkdocs-based projects.
- Preserve mkdocstrings injection blocks and cross-references during automated Markdown reformatting.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
An mdformat plugin that formats Markdown for MkDocs projects, handling MkDocs-specific syntax like admonitions, content tabs, definition lists, and math notation while standardizing indentation and list formatting.
Yes. Active maintenance, no vulnerabilities, low install friction, and permissive MIT license make this a safe choice. Install it if you format Markdown in MkDocs or Material for MkDocs projects and want a formatter that understands your project's syntax without corrupting extensions. Skip it if you don't use MkDocs or have no need for automated Markdown formatting.
Install
mdformat-mkdocs on PyPI
pip
pip install mdformat-mkdocsuv
uv add mdformat-mkdocspoetry
poetry add mdformat-mkdocsInstalling mdformat-mkdocs
Before you install
Low friction install with four runtime dependencies (mdformat, mdformat-gfm, mdit-py-plugins, more-itertools). Active maintenance with a release 12 days ago and no known vulnerabilities.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects.
Quickstart
pip install mdformat-mkdocs
# mdformat-mkdocs auto-registers as an mdformat plugin
mdformat your_docs.md
# Or with options:
mdformat --number your_docs.md # Apply consecutive numbering to ordered lists
Requires Python 3.10.0 or later.
Verify before relying
- Whether the package handles all edge cases in nested mkdocstrings injection blocks with --align-semantic-breaks-in-lists
- Performance characteristics when formatting large documentation projects
- Compatibility with custom MkDocs extensions beyond those explicitly listed
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — mdformat, mdformat-gfm, mdit-py-plugins, more-itertools |
| Maintenance | actively maintained — 12 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 158,177/month — #10,733 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mdformat_mkdocs-5.3.0-py3-none-any.whl
Keywords: markdown, markdown-it, mdformat, mdformat_plugin_template
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
mdformat-gfm-alertsA plugin for mdformat that formats GitHub…
permissive · top 15,000 on PyPI
mdx-truly-sane-listsA Python-Markdown extension that fixes list…
permissive · top 5,000 on PyPI
pymdown-extensionsPymdown Extensions provides a collection of…
permissive · top 1,000 on PyPI
mdformat-footnoteAdds footnote parsing and formatting support to…
permissive · top 15,000 on PyPI
mdformat_deflistExtends mdformat with support for parsing and…
permissive · top 15,000 on PyPI
mdformatMdformat is a CommonMark-compliant command-line…
permissive · top 5,000 on PyPI
mkdocs-github-admonitions-pluginA MkDocs plugin that converts GitHub-flavored…
permissive · top 15,000 on PyPI
markdown-calloutsAdds a cleaner block-level syntax to Markdown…
permissive · top 15,000 on PyPI
mdformat-front-mattersA plugin for mdformat that normalizes YAML,…
permissive · top 15,000 on PyPI
mkdocs-techdocs-coreBundles Spotify's TechDocs defaults—themes,…
permissive · top 15,000 on PyPI