A streaming Markdown renderer for your terminal, great to render the output of LLM tools
Project description
mdrender
A streaming Markdown renderer for your terminal, great to render the output of LLM tools. It reads from stdin and prints formatted Markdown in real time, buffering blocks (like code fences, tables, lists) so they render properly.
Features
- Handles streamed input line-by-line
- Supports headers, lists, nested lists
- Syntax-highlighted code fences
- Tables, blockquotes, inline styles
Installation
pip install mdrender
Usage
Send markdown content via stdin
cat file.md | mdrender
Of course, the main goal is to able to render streaming input. For example, to render the live output produced by a LLM chat:
llm 'generate a dummy markdown' | mdrender
You can simulate streaming with the following bash one-liner:
cat test.md | while IFS= read -r line; do for (( i=0; i<${#line}; i++ )); do echo -n "${line:$i:1}" && sleep 0.001; done; echo; done | mdrender
I actually use that to test the tool while developing (with the test file at
mdrender/test.md)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mdrender-0.1.0.tar.gz.
File metadata
- Download URL: mdrender-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a51399dceeb34b1674bd697c6d10c109f385839c2f6e6626c94039c94d65a768
|
|
| MD5 |
016403fc308d33b6f33dadb9dd7316e8
|
|
| BLAKE2b-256 |
412a09ab930461dbae63ca57d163a94b9b8c2fa4ee0834a2576d9768d91acbab
|
File details
Details for the file mdrender-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mdrender-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d288a140f5bffdcfbbc1ea7386027c5a2cdc60bdf605a729bc415949d6630f0
|
|
| MD5 |
eb4bb91889090fa715234c1107740fc7
|
|
| BLAKE2b-256 |
21a164d51f6b6849b143f973e854ce07fc789d022a208313f7da4872472a5582
|