Skip to main content

Print Markdown — terminal Markdown renderer with ANSI formatting. Zero dependencies.

Project description

pmd — Print Markdown

Terminal Markdown renderer. Zero dependencies. One command.

pmd renders Markdown files directly in your terminal with ANSI colors and Unicode box-drawing characters. No browser, no GUI, no npm install. Just Python 3.9+ and pip install pmd-cli.

PyPI Python 3.9+ License MIT

Quick start

pip install pmd-cli # or: pipx install pmd-cli
pmd README.md
cat doc.md | pmd    # stdin works too

Features

Headings — 6 levels with colors

Level Style Marker
H1 White on magenta
H2 White on blue
H3 Black on cyan
H4–H6 Green / Yellow / Gray

No underlines, no # prefixes — just color and shape.

Inline formatting

  • Bold **text**
  • Italic *text*
  • Bold-italic ***text***
  • Strikethrough ~~text~~
  • Codebold green for visibility
  • Links — blue underlined

Code blocks — bordered, language-tagged

┌ python ──────────────────
│ def hello():
│     print("world")
└──────────────────────────

Clean box borders, language label in the top frame. No syntax highlighting — just readable code.

Tables — autofit, cell wrapping, inline formatting

┌──────────┬───────┬─────────────────┐
│ Name     │ Age   │ City            │
├──────────┼───────┼─────────────────┤
│ Alice    │ 30    │ Beijing         │
│ Bob      │ 25    │ Shanghai        │
└──────────┴───────┴─────────────────┘
  • Unicode box-drawing glyphs
  • Columns autofit to content — compact by default
  • Long cells wrap within their column
  • Inline formatting (`code`, **bold**) preserved inside cells

Task lists

  ● Completed task
  ○ Pending task

GFM-style - [x] / - [ ] rendered as green filled / gray empty circles. Mix with regular list items freely.

Blockquotes

▎ Cyan bar + dimmed text
▎ Clean and compact

CJK / Emoji support

Chinese, Japanese, Korean characters measured at correct display width (2 columns). Table alignment and text wrapping work properly for mixed-script documents.

Why pmd?

Tool Language Dependencies
pmd Python 3 Zero
glow Go Requires Go toolchain or prebuilt binary
rich-cli Python rich + 10+ transitive deps
mdcat Rust Requires Rust or prebuilt binary
mdr Ruby Requires Ruby + gem install

pmd is the lightest option when you need markdown rendering on a server, container, CI runner, or air-gapped machine where installing compilers or heavy packages isn't practical.

Alternatives vs. built-in less / cat

These show raw markdown source:

# Heading                ← looks like a comment
**bold** *italic*        ← noise characters everywhere
| table | columns |      ← misaligned without rendering

pmd shows the rendered document — the way it was meant to be read.

Install

pip install pmd-cli          # system-wide
pip install --user pmd-cli   # user only
pipx install pmd-cli         # isolated CLI (recommended)

Python 3.9 or later. No other dependencies.

Usage

# File
pmd README.md

# Stdin
curl -s https://example.com/doc.md | pmd

# From clipboard (macOS)
pbpaste | pmd

# From clipboard (Linux)
xclip -o | pmd

Project structure

src/pmd/
  __init__.py      # version
  __main__.py      # parser + renderer (~850 lines)
pyproject.toml     # pip metadata

Single-file core — easy to vendor, fork, or embed.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pmd_cli-1.0.1.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pmd_cli-1.0.1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file pmd_cli-1.0.1.tar.gz.

File metadata

  • Download URL: pmd_cli-1.0.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pmd_cli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7c39ad244671fb043bf04c54b1a84e36e26115003088ea643bf203b31550aca0
MD5 1134e5cb3b6bf8227449a79b2ead3af8
BLAKE2b-256 d40b2c44e8c7e980a25f2f413782def7791c619b111b823f19262f5f3735c72c

See more details on using hashes here.

File details

Details for the file pmd_cli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pmd_cli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for pmd_cli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 294253c26fd34f4696882be8011f8902849572cee27012c376e7d68e79c272b1
MD5 ff1bd7345920fcb4f1b06991550613c5
BLAKE2b-256 42627f0ad747a508110e19cb95492193caaa6659c4f48b971f1036166018fd8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page