mdformat-toc
Mdformat plugin to generate table of contents
Decision gist · record as of 2026-08-14
Yes, if you use mdformat and need automated table-of-contents generation in Markdown files. The package is straightforward to install, has no security vulnerabilities, and works with current Python versions. The 303-day gap since last release suggests maintenance rather than active development, but the repository is not archived and the plugin remains functional for its intended use.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires mdformat to be installed; mdformat-toc works as a plugin that extends mdformat's formatting capabilities.
- Low friction install with a single runtime dependency on mdformat.
- The package is aging (303 days since last release) but the repository remains active and not archived, with support for current Python versions (3.9 through 3.14).
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice.
last release 2025-10-15 (303 days) · last repo commit 2025-10-15 · 27 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 105,855 downloads/mo, #12,675 on PyPI
Alternatives
Verify before relying
pip install mdformat-toc
# Add to your Markdown file:
# <!-- mdformat-toc start -->
# Then run:
mdformat your_file.md- Whether the package is actively maintained or in maintenance-only mode given the 303-day gap since last release.
- Real-world compatibility with Markdown renderers other than GitHub and GitLab.
What it is and what it does
Mdformat-toc extends mdformat, a Markdown formatter, with the ability to automatically generate and update a table of contents. You mark a location in your Markdown file with an HTML comment (<!-- mdformat-toc start -->), then run mdformat, and the plugin generates a ToC listing the headings in your document at that location.
By default, the plugin creates HTML anchors for each heading so ToC links work across different Markdown renderers. You can configure which heading levels to include, disable anchor generation, and choose between GitHub and GitLab slug functions for link generation. The plugin is designed to work with mdformat's standard formatting workflow and requires only mdformat as a runtime dependency.
Use it for
- Auto-generate and keep a table of contents synchronized in long Markdown documentation files.
- Maintain consistent heading-to-anchor mappings across GitHub and GitLab hosted Markdown.
- Integrate ToC generation into CI/CD pipelines that already use mdformat for Markdown formatting.
- Generate navigable ToCs in README files without manually updating links when headings change.
- Configure heading-level filtering to create ToCs that exclude top-level or deeply nested headings.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you use mdformat and need automated table-of-contents generation in Markdown files.
The package is straightforward to install, has no security vulnerabilities, and works with current Python versions. The 303-day gap since last release suggests maintenance rather than active development, but the repository is not archived and the plugin remains functional for its intended use.
Install
mdformat-toc on PyPI
Before you install
Low friction install with a single runtime dependency on mdformat. The package is aging (303 days since last release) but the repository remains active and not archived, with support for current Python versions (3.9 through 3.14).
Requires mdformat to be installed; mdformat-toc works as a plugin that extends mdformat's formatting capabilities.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you retain the license notice.
Quickstart
pip install mdformat-toc
# Add to your Markdown file:
# <!-- mdformat-toc start -->
# Then run:
mdformat your_file.md
Verify before relying
- Whether the package is actively maintained or in maintenance-only mode given the 303-day gap since last release.
- Real-world compatibility with Markdown renderers other than GitHub and GitLab.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagemdformat |
| Maintenance | Aging 303 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 105,855 / month, #12,675 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Text Processing :: MarkupTyping :: Typed |
Evidence: mdformat_toc-0.5.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “markdown table of contents generator”
- mdformat-tocMdformat-toc is an mdformat plugin that automatically generates and…
- mkdocstrings-python-legacyA legacy Python documentation handler for mkdocstrings that extracts…
- markdown-pdfConverts markdown text to PDF files, with support for tables, images,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Markup packages
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
A Python markdown parser that converts markdown to HTML following the CommonMark specification, with support for plugins and custom syntax rules.
Install it if you need reliable markdown-to-HTML conversion.
Beautiful Soup parses HTML and XML documents into a navigable tree, providing Pythonic methods to search, iterate, and modify the parsed content.
Install it if you need to parse or extract data from markup documents.
et_xmlfile writes large XML files with minimal memory overhead by serializing elements to disk as they are created, rather than holding the entire tree in memory.
Install it if incremental XML writing fits your use case; skip it if your XML documents are small or you already use lxml.
Parses and edits TOML files while preserving formatting, comments, and structure, then serializes them back with layout intact.
Install it if you're building tools that touch TOML files and user readability of the source matters.
Parses Python docstrings in ReST, Google, Numpydoc, and Epydoc formats, extracting structured information like descriptions, parameters, return types, and exceptions.
Install it if you need to programmatically read and extract structured data from Python docstrings.
See also mdformat_myst · mdformat · mdformat-black · mdformat-ruff · mdformat-mkdocs · mdformat-gfm · mdformat_tables · mdformat-frontmatter · tomli-w · markdown-pdf