Skip to main content

Fast Markdown previewer with GitHub-dark theme, sidebar TOC, multi-file tabs, and .openmd.css theming

Project description

openmd

Markdown viewer for humans — not AI models.

I got tired of reading raw Markdown with less or opening VS Code/Cursor just to see it nicely rendered. So I built openmd.

Run openmd *.md (or any Markdown files) from the shell and a window pops up with:

  • Tabs for multiple files (up to 6)
  • Live reload when you save in your editor
  • Mermaid diagrams and KaTeX math
  • Collapsible navigation sidebar (TOC)
  • Full customization via .openmd.css

No browser, no TUI — just proper rendering with nice fonts and styles. It runs in the background so the window stays completely independent.

Built this for myself and I use it every day - because nice-looking text matters! 🤣

Python 3.8+ License: MIT Platform: macOS PyPI version

GitHub: RufusLin/openmd

Warning - Lazy Maintainer: Yeah, not a fan of reading PRs, but will pay attention to issues to fix bugs. Feel free to fork, but remember to give credit, please.🙏🏻

X: @rufuslinjapan


Usage

# Open a single file
openmd README.md

# Open multiple files (each in its own tab)
openmd doc1.md doc2.md doc3.md

# No arguments — interactive picker (choose from .md files in current directory)
openmd

# Glob expansion
openmd docs/*.md

Shell aliases (optional)

Add to your ~/.zshrc or ~/.bashrc for quick access to remote files:

# Remote preview via SSH (requires a 'home' SSH alias in ~/.ssh/config)
remotemd() {
    local remote_path="$1"
    local filename=$(basename "$remote_path")
    local tmp_file="/tmp/remote_preview_${filename}.md"
    scp "home:$remote_path" "$tmp_file" && \
    openmd "$tmp_file" >/dev/null 2>&1 &
}

What it looks like

openmd with multiple tabs and TOC sidebar Mermaid diagram and KaTeX math rendered

(Click any image to enlarge)

Features

  • GitHub-dark theme — comfortable reading in low-light environments. BUT! Change it to whatever you like in .openmd.css
  • Live reload — the preview updates instantly when the file is saved; no manual refresh needed
  • Mermaid diagrams — fenced ```mermaid blocks render automatically via CDN
  • KaTeX math — Formulae? inline $…$ and display $$…$$ expressions render out of the box
  • Collapsible sidebar TOC — hierarchical, of course; click any heading to jump to it
  • Multi-file tabs — pass multiple .md files (even *.md globs) and each opens in its own tab, max 6
  • Interactive file picker — run with no arguments and choose from .md files in the current directory via a curses-based picker — no need to copy and paste file names
  • Remote preview — optional remotemd shell alias pulls a file from a remote host via scp and opens it instantly
  • Keyboard shortcutsEsc closes the window; arrow keys navigate the sidebar

Requirements

Note: Mermaid and KaTeX require an internet connection to load from CDN.


Installation

pip (recommended)

pip install openmd

After installing, the openmd command is available in your shell.

From source

git clone https://github.com/RufusLin/openmd.git
cd openmd
pip install -e .

Keyboard shortcuts in sidebar

Key Action
Esc Close the preview window
/ Navigate the sidebar TOC
Return Jump to selected section

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

openmd-1.4.11.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

openmd-1.4.11-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file openmd-1.4.11.tar.gz.

File metadata

  • Download URL: openmd-1.4.11.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for openmd-1.4.11.tar.gz
Algorithm Hash digest
SHA256 0f1a0d1cdcdf7dcc64b4ce66524de12446172042e485f54c3c99e1d8302cda27
MD5 31738b3c042b1cb0f99e3047058a070f
BLAKE2b-256 2d21a3fc665bd4df1d48e16f105ab30994bed69808dc684f70c0d982b8f0e890

See more details on using hashes here.

File details

Details for the file openmd-1.4.11-py3-none-any.whl.

File metadata

  • Download URL: openmd-1.4.11-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for openmd-1.4.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ab81c39b1ec6488028ea313b2c0fc881d231835c89b85d2220055e09d3268e42
MD5 db5541e27d719828b46d21775fd72d14
BLAKE2b-256 5c6567689d3b872d877e3bed2c6e799eb90b2297971970bdd500cc7ed7d8596a

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