multimark

Python bindings to cmark: CommonMark parsing and rendering (HTML, LaTeX, man, XML)

AI / Agents

Skills
llms.txt
llms-full.txt

Developers

Rich Iannone

Maintainer

Community

Contributing guide
Code of conduct
Project roadmap
Full license MIT

Meta

Requires: Python >=3.9
Tags

Fast Python bindings to cmark-gfm, the C reference implementation of CommonMark with GitHub Flavored Markdown extensions. Render Markdown to five output formats from a single, lightweight package.

Install and Go

pip install multimark

Wheels are available for Linux, macOS, and Windows (Python 3.9+). No system dependencies required.

from multimark import markdown_to_html

markdown_to_html("**Hello**, *world*!")
## '<p><strong>Hello</strong>, <em>world</em>!</p>\n'

Five Output Formats

Function Output
markdown_to_html() HTML
markdown_to_latex() LaTeX
markdown_to_man() groff man page
markdown_to_commonmark() Normalized CommonMark
markdown_to_xml() XML (AST)

Every renderer shares the same interface: pass a Markdown string, get formatted output back. No intermediate objects, no setup.

GitHub Flavored Markdown Built In

Enable tables, strikethrough, autolinks, task lists, and tag filtering with a single argument:

from multimark import markdown_to_html

markdown_to_html(
    "| A | B |\n|---|---|\n| 1 | 2 |\n",
    extensions=["table"],
)

Safe by Default

Raw HTML is stripped from output unless you explicitly opt in with unsafe=True. Smart punctuation, source position mapping, footnotes, and line wrapping are all one keyword argument away.

markdown_to_html('"Hello" -- world...', smart=True)
## '<p>\u201cHello\u201d \u2013 world\u2026</p>\n'