Skip to main content

mdhtml2term

Render MDHTML Markdown as ANSI-styled terminal rows. Python and Rust use the same renderer.

Python

Install with pip install mdhtml2term.

from mdhtml2term import render

markdown = "# Results\n\nThe **baseline** scored 92%."
print(*render(markdown, width=72), sep="\n")

Rust

Add the crate with cargo add mdhtml2term.

let markdown = "# Results\n\nThe **baseline** scored 92%.";
for row in mdhtml2term::render(markdown, 72) { println!("{row}"); }

Pass the available width in terminal columns, excluding any gutter. Render again after a resize. Each row contains text and SGR styles, with no trailing newline or cursor commands.

Sections and citations

Use render(markdown, width) to display a document, or sections(markdown, width) to select individual blocks. A section has the original Markdown in source, its display lines in rows, and a code flag for code blocks. Collected footnote definitions form a final section. Pass the whole document to either function so citations can refer to a later ::: bibliography and footnote numbering works across blocks.

Both functions inherit the document's citation style. In Python, pass cite_style="numeric" or cite_style="author-year" to override it. In Rust, use render_with_style or sections_with_style with a third argument such as Some(mdhtml2term::CiteStyle::Numeric). Unresolved citation keys remain visible.

HTML and code

Use render_html(html, width) for an HTML fragment such as notebook cell output. highlight(text, language, width) renders literal code. For an editor, highlight_spans(text, language) returns unwrapped (SGR prefix, original text) pairs that preserve tabs and newlines.

Metadata

Release files for mdhtml2term 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mdhtml2term 0.1.9
File Size Uploaded Provenance Actions
mdhtml2term-0.1.9.tar.gz 16.7 kB With provenance Details for mdhtml2term-0.1.9.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for mdhtml2term 0.1.9
File Interpreter ABI Platform Actions
mdhtml2term-0.1.9-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for mdhtml2term-0.1.9-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
mdhtml2term-0.1.9-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for mdhtml2term-0.1.9-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
mdhtml2term-0.1.9-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for mdhtml2term-0.1.9-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 8.0 MB

Release files / mdhtml2term-0.1.9.tar.gz

Download URL mdhtml2term-0.1.9.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
666a16718d66d0a65383fc302e81a1f966a855b03e3b50aec2bbd16032c89045
BLAKE2b-256 checksum
How to use checksums
e25b63354bd7409488fb49a14de78495177a37bc3eb3b34df45f2ab57157cc75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mdhtml2term-0.1.9-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL mdhtml2term-0.1.9-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
6b4509ff343d0d767aa3e29ef91945dc7c2eca5dba7624efbe31f2025e363030
BLAKE2b-256 checksum
How to use checksums
42f4c5611881c6b2fcd4ea91cae3784548a381fcae57d61a5c9b45d60a63fc8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mdhtml2term-0.1.9-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL mdhtml2term-0.1.9-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.5 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
61e0ce0f5a26a8703ae47d815c10a1ab72c0249fb89ebc48d0bb094b057a31a0
BLAKE2b-256 checksum
How to use checksums
59a958ffc7ebb5cc59b493e2b67eaca7549e7bcce315f9434a40daaab94bd549
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / mdhtml2term-0.1.9-cp310-abi3-macosx_11_0_arm64.whl

Download URL mdhtml2term-0.1.9-cp310-abi3-macosx_11_0_arm64.whl
Size 2.8 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cd307ce651d4cf530b3bf6d89d37d602d70adb760864e15185e412fdf103e5ca
BLAKE2b-256 checksum
How to use checksums
62a2dd019d2a6810360391793e89bde444055eca0502fbeda867f40c820cadb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for mdhtml2term 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for mdhtml2term-0.1.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page