mdit-py-plugins
A collection of core syntax plugins for the markdown-it-py parser
Repository Health
Technical Analysis
mdit-py-plugins is a curated collection of plugins for markdown-it-py, the Python port of the markdown-it Markdown parser. It extends the base CommonMark parser with additional syntax such as footnotes, definition lists, task lists, front matter, admonitions, and inline/display math.
Each plugin registers extra parsing rules and render behavior on a MarkdownIt instance, letting authors compose exactly the Markdown feature set they need. It underpins richer Markdown handling in tools like MyST and Jupyter Book, and is a heavily downloaded dependency across the Python documentation ecosystem.
What You Get
- A large set of ready-made markdown-it-py plugins in a single dependency
- Extensions for footnotes, definition lists, task lists, and admonitions
- Math support via dollarmath and texmath, plus front matter and field lists
- GitHub-flavored extras like autolinks, plus MyST-oriented roles and blocks
Common Use Cases
- Adding footnotes, task lists, or tables to a markdown-it-py based renderer
- Enabling LaTeX-style math in Markdown documentation and notebooks
- Building MyST/Jupyter Book style extended Markdown parsing pipelines
Under The Hood
Architecture - The package is organized as one submodule per plugin under mdit_py_plugins (for example footnote, deflist, tasklists, front_matter, dollarmath, texmath, admon, field_list, gfm_autolink, myst_blocks, myst_role). Each exposes a plugin function that is passed to MarkdownIt.use(...); internally it registers block or inline rules into markdown-it-py’s rule chain and attaches token renderers, following markdown-it’s core-rule/state architecture. Shared helpers live in utils.py.
Tech Stack - It is pure Python and depends on markdown-it-py as the underlying parser engine. It is packaged for both PyPI and conda, formatted with black, and CI-tested with coverage reporting via GitHub Actions and Codecov.
Code Quality - The repo has a thorough tests/ tree with per-plugin test modules and fixtures (many plugins have both a .py test and a fixtures directory), reflecting spec-style coverage of each syntax extension. Development is active and the codebase is mature and typed (ships py.typed).
API Design - The API is uniform and composable: every plugin is a function applied through md.use(plugin, **options), mirroring the JavaScript markdown-it plugin convention. This consistency means learning one plugin teaches you all of them, and callers opt into exactly the syntax extensions they want.