Skip to main content

mdhtml2term

Render MDHTML Markdown in the terminal with Rich.

md_blocks parses Markdown with mdhtml and returns one Rich renderable per top-level block. A terminal app can then print, fold or replace each block on its own. ipyai uses it to render AI replies.

Install

pip install mdhtml2term

Usage

from rich.console import Console
from mdhtml2term import md_blocks

console = Console()
for block in md_blocks(markdown_text): console.print(block)

md_blocks takes a Markdown string and returns a list of Rich renderables. theme names the Pygments theme for code blocks and defaults to ansi_dark. Other keyword arguments go to mdhtml.parse_md. The shared Rust document engine resolves references and assigns numbers. Unresolved references show their target ids.

Supported content

  • Headings, paragraphs, block quotes, lists, code blocks, tables and horizontal rules. Block quotes and list items can hold any other block, including code and further quotes.
  • Bold, italic, inline code, strikethrough, highlight and line breaks.
  • Links, as OSC 8 hyperlinks followed by their address in brackets.
  • Images, as their alt text in square brackets.
  • Task list checkboxes, as [ ] and [x].
  • A numbered list that resumes after other content keeps its numbering.

Other inline elements show their text. Other block containers render their children. Raw payloads and unresolved template instructions are omitted.

Metadata

Release files for mdhtml2term 0.1.1

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.1
File Size Uploaded Provenance Actions
mdhtml2term-0.1.1.tar.gz 9.5 kB Without provenance Details for mdhtml2term-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mdhtml2term 0.1.1
File Interpreter ABI Platform Actions
mdhtml2term-0.1.1-py3-none-any.whl Python 3 none any Details for mdhtml2term-0.1.1-py3-none-any.whl

Total release size: 18.1 kB

Release files / mdhtml2term-0.1.1.tar.gz

Download URL mdhtml2term-0.1.1.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
70dd89430d20e2965f65884316d2df6ee29729a53b81ab602477c0223782beed
BLAKE2b-256 checksum
How to use checksums
fdd1147ef8c861ce3d456ffcdeaa350bac481917b0765f2a6c4cfdfcd09477bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / mdhtml2term-0.1.1-py3-none-any.whl

Download URL mdhtml2term-0.1.1-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56ac84b6f12fb6ba5dbc8ba4162f47c3672acc8888538ada43d775a1766e83b9
BLAKE2b-256 checksum
How to use checksums
9ae4c7ea8ab18dc0ba1beafde7def74d52b6e8081ee53723311eb566ae66072f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for mdhtml2term 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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