Skip to main content

Drop-in single-file Markdown viewer for any folder

Project description

md-viewer-py

md-viewer-py

PyPI version Python versions License

Drop-in Markdown viewer for any folder — installable via pip.

Install once, use everywhere as mdview.

File view — Light theme

File view — Dark theme


Install

pip install md-viewer-py

Or with uv:

uv tool install md-viewer-py

Or run without installing:

uvx --from md-viewer-py mdview

Or with pipx:

pipx install md-viewer-py

Then run from any directory:

mdview                        # serve current directory on port 8080
mdview 3000                   # custom port
mdview /path/to/docs          # custom directory
mdview /path/to/docs 3000     # both

Or run as a Python module without installing:

python -m md_viewer

Features

Dashboard — Light theme

Dashboard — Dark theme

  • Minimal dependencies — only watchdog for live reload, auto-installed with pip
  • pip/pipx installable — install once, use anywhere as mdview
  • Dashboard page — grid view of folders and files, macOS Finder-style
  • Dark & light themes — polished UI with OS-aware theme toggle
  • File tree sidebar — folder navigation with collapsible directories
  • Full-text search — debounced search across all Markdown files with lazy loading
  • Table of contents — auto-generated with scroll spy and collapsible groups
  • Collapsible sections — click any heading to collapse/expand its content
  • In-browser editing — toggle edit mode with toolbar, live preview, and save to disk
  • Live reload — instant updates via SSE and native file system watching (watchdog)
  • Syntax highlighting — code blocks highlighted with highlight.js
  • Mermaid diagrams — flowcharts, sequence diagrams, and more rendered inline
  • .gitignore support — respects ignore patterns from root and subdirectories
  • Gzip compression — all responses compressed, ETag caching for the HTML page
  • Keyboard shortcuts — arrow keys to navigate, / to search
  • Reading progress bar — visual indicator of scroll position
  • Mobile responsive — works on small screens with hamburger menu
  • Print-friendly — clean print stylesheet for hard copies
  • Custom port and directory — point it at any folder, pick any port

Quick Start

pip install md-viewer-py
mdview

A browser tab opens automatically at http://localhost:8080.

Examples

Keyboard Shortcuts

Key Action
/ or Ctrl+K Focus search
Previous file
Next file

How It Works

md-viewer-py is a pip-installable HTTP server built on Python's http.server. It scans the directory for .md files, serves a single-page dark-themed UI, and renders Markdown client-side using marked.js from a CDN. No build step, no config files, no virtual environments beyond the install itself.

Alternative: Copy and Run

No install needed — just drop the wrapper into any folder:

python3 md-viewer.py

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines and the improvements & ideas list for open tasks.

Feel free to open an issue to discuss ideas before starting work.

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

md_viewer_py-1.0.8.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

md_viewer_py-1.0.8-py3-none-any.whl (31.3 kB view details)

Uploaded Python 3

File details

Details for the file md_viewer_py-1.0.8.tar.gz.

File metadata

  • Download URL: md_viewer_py-1.0.8.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for md_viewer_py-1.0.8.tar.gz
Algorithm Hash digest
SHA256 a37cb0cf7d6b485e676e1840c874f297098619af3ff4ccaa9664c9eff6317c5f
MD5 e3f56b2ef2cd44068b8fd8e1c2e1f3e2
BLAKE2b-256 76eac15bf763d5e8e9da1cec3b46a24e9c702f7e9674ff98e2a394260f913040

See more details on using hashes here.

File details

Details for the file md_viewer_py-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: md_viewer_py-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 31.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for md_viewer_py-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 0dc2c455231062925c7e10c873648ccd0d63d06fc867fad942dd6a954cb64216
MD5 80333b5371ff84d4abf13b9e98d30526
BLAKE2b-256 d05fb6e98036da4d09ec7079b3eb4b211bca64a384a4783a0a12dd22830d49fe

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