Skip to main content

markdown-print

A thin wrapper around Rich's markdown renderer with opinionated defaults for terminal display. Rich does all the actual parsing and rendering, this package just configures it with:

  • Nord-darker theme for code blocks with matching inline code styling
  • Left-aligned headings with visible # prefix markers
  • H1 rendered in a panel, other headings styled normally
  • An interactive reader with mouse selection and clipboard copying
  • Horizontally centered content within a 100-character width
  • A render_markdown() function for programmatic use

I found myself continually copying this around or making one-off scripts with these defaults, so I packaged it up in a repo so I can install it as needed.

There's intentionally no config files nor are there a lot of options, it's meant to represent how I prefer markdown rendered in the terminal.

Markdown rendered in terminal with mdp

Installation

uv tool install markdown-print

Usage

mdp path/to/file.md

Drag across any part of the document and release to copy the highlighted text. Paste normally in another app. The copy omits the centering margin and code-block padding, preserves code indentation, and contains no color escape sequences. Rendered line breaks and visible Markdown decorations (such as list bullets) are preserved.

You can also press Ctrl+C or y to copy the selection again. Esc clears it. Use the mouse wheel or arrow keys to scroll, Space/b or Ctrl+F/Ctrl+B to page down/up, g/G to jump to the beginning/end, and q to quit. / opens search; press Enter to find text and n/N for the next/previous matching line.

Copying uses pbcopy on macOS, or wl-copy, xclip, or xsel when available on Linux. Otherwise, including over SSH, it sends a clipboard request to your terminal using OSC 52. The terminal must support and allow these requests; the status bar distinguishes a native copy from a request sent to the terminal. Drag without holding Shift, which many terminals reserve for their own selection (including the centering spaces).

Use --pager less for the original less -R reader, or --no-page to print directly. The default reader prints normally when input or output is redirected. Clean mouse copying is available in the interactive reader.

Development

This project requires Python 3.12 and uses uv to manage dependencies.

You can create a virtual environment with all the necessary dependencies by running:

uv sync --all-extras --dev

This will install all necessary dependencies and install this project in editable mode.

You can activate the venv with:

. .venv/bin/activate

Releases

To publish a new pypi release, bump all the version, create a git tag, and push everything up to GitHub. There's a helper script you should use:

$ ./scripts/stage-release patch

... omitted ...
You can now run:

git push origin main --tags


$ git push origin main --tags

Metadata

Release files for markdown-print 0.1.0

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

Source distribution (sdist)

Source distribution for markdown-print 0.1.0
File Size Uploaded Provenance Actions
markdown_print-0.1.0.tar.gz 233.5 kB With provenance Details for markdown_print-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for markdown-print 0.1.0
File Interpreter ABI Platform Actions
markdown_print-0.1.0-py3-none-any.whl Python 3 none any Details for markdown_print-0.1.0-py3-none-any.whl

Total release size: 250.6 kB

Release files / markdown_print-0.1.0.tar.gz

Download URL markdown_print-0.1.0.tar.gz
Size 233.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3db2d83a856ee59328158c15fdb1c86fadf8386473682e8bb1b001aebce4d3d5
BLAKE2b-256 checksum
How to use checksums
24df491e67a209474d72cbadb2f1221ac2d2c4a24809a6bece36b079310e250e
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 3, 2026.

Transparency log

Release files / markdown_print-0.1.0-py3-none-any.whl

Download URL markdown_print-0.1.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f3bf97c92107e7c149bf08f1e7dd1bacec781f92af5206d3c7f43da147d6d99
BLAKE2b-256 checksum
How to use checksums
27a2af96919aa363ad03f197a98e3b24e46166f96a30f4f9f60db01c89df7990
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 3, 2026.

Transparency log

Security for markdown-print 0.1.0

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for markdown_print-0.1.0.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 3, 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