Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

markdown-it-py

> 编程语言
Open source

Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed. Now in Python!

1.3K stars0 likes2 views
WebsiteGitHub

About

Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed. Now in Python!

markdown-it-py

Github-CI Coverage Status PyPI Conda PyPI - Downloads

Markdown parser done right.

  • Follows the CommonMark spec for baseline parsing
  • Configurable syntax: you can add new rules and even replace existing ones.
  • Pluggable: Adds syntax extensions to extend the parser (see the plugin list).
  • High speed (see our benchmarking tests)
  • Easy to configure for security
  • Member of Google's Assured Open Source Software

This is a Python port of markdown-it, and some of its associated plugins. For more details see: https://markdown-it-py.readthedocs.io.

For details on markdown-it itself, see:

  • The Live demo
  • The markdown-it README

See also: markdown-it-pyrs for an experimental Rust binding, for even more speed!

Installation

PIP

bash
pip install markdown-it-py[plugins]

or with extras

bash
pip install markdown-it-py[linkify,plugins]

Conda

bash
conda install -c conda-forge markdown-it-py

or with extras

bash
conda install -c conda-forge markdown-it-py linkify-it-py mdit-py-plugins

Usage

Python API Usage

Render markdown to HTML with markdown-it-py and a custom configuration with and without plugins and features:

python
from markdown_it import MarkdownIt
from mdit_py_plugins.front_matter import front_matter_plugin
from mdit_py_plugins.footnote import footnote_plugin

md = (
    MarkdownIt("commonmark", {"breaks": True, "html": True})
    .use(front_matter_plugin)
    .use(footnote_plugin)
    .enable("table")
)
text = """
---
a: 1
---

a | b
- | -
1 | 2

A footnote [^1]

[^1]: some details
"""
tokens = md.parse(text)
html_text = md.render(text)

## To export the html to a file, uncomment the lines below:
# from pathlib import Path
# Path("output.html").write_text(html_text)

Command-line Usage

Render markdown to HTML with markdown-it-py from the command-line:

…

Tables are disabled by default, as in CommonMark. Use --enable-tables with any input mode to enable them:

bash
markdown-it --enable-tables README.md > index.html
markdown-it --enable-tables --stdin < README.md > index.html
markdown-it --enable-tables

References / Thanks

Big thanks to the authors of markdown-it:

  • Alex Kocharin github/rlidwka
  • Vitaly Puzrin github/puzrin

Also John MacFarlane for his work on the CommonMark spec and reference implementations.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Pythonmarkdownmarkdown-itmarkdown-parser

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言