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.

Dashboard — Light theme

File view — Light theme

Dashboard — Dark theme

File view — Dark theme


Install

pip install md-viewer-py

Or with pipx (recommended for CLI tools):

pipx install md-viewer-py

Or install directly from source:

pip install .

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

  • Minimal dependencies — only watchdog for live reload, auto-installed with pip
  • pip/pipx installable — install once, use anywhere as mdview
  • Dashboard landing 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.7.tar.gz (30.0 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.7-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: md_viewer_py-1.0.7.tar.gz
  • Upload date:
  • Size: 30.0 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.7.tar.gz
Algorithm Hash digest
SHA256 d8f587f00f95da3af24823e7501ebad24f0e26e23eb097fe28c4037ac3a487ba
MD5 8e708a490ccf0b605aaa9e41721235db
BLAKE2b-256 318fe1e0daf3eb9726c1edfe1828dc8dcc54d8f685bec7164a170f3e1ebf80b9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: md_viewer_py-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 29.4 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 ba0ec937aa2563546428123bec6cb520e39394634306ee04060386a7a54fbc2b
MD5 bdfb9c8a98424fd767c0700d0853a22a
BLAKE2b-256 24b74c54e8aa8e52396007d8eb167dcfc01c854a9b2b204a6808ffd9a32fe96c

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