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.

Zero dependencies. Install once, use everywhere as mdview.

Dark theme Light 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

  • Zero dependencies — Python standard library only, nothing to install
  • pip/pipx installable — install once, use anywhere as mdview
  • Dark theme UI — polished dark interface, easy on the eyes
  • File tree sidebar — folder navigation with collapsible directories
  • Full-text search — search across all Markdown files instantly
  • Table of contents — auto-generated with scroll spy and collapsible groups
  • Collapsible sections — click any heading to collapse/expand its content
  • .gitignore support — respects ignore patterns, skips .git, node_modules, etc.
  • 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
  • Live content refresh — file list and content auto-refresh as files change

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.

If you'd like to help but aren't sure where to start, see the full improvements & ideas list or pick from these highlights:

  • Light theme / theme switcher
  • Syntax highlighting for code blocks (highlight.js)
  • Mermaid diagram support
  • Live reload on file changes
  • Export to PDF or static HTML

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.6.tar.gz (27.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.6-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: md_viewer_py-1.0.6.tar.gz
  • Upload date:
  • Size: 27.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.6.tar.gz
Algorithm Hash digest
SHA256 22b5948054d2386523b3f5d56041576ace9b2f7d7929f53e34c517e9a2eab89c
MD5 1931f741baf55c1b76b38aabbe99ab10
BLAKE2b-256 bf42effa1bed2b5d8ac6143b43f397f1064f09dad30b16d02539ccba5ab4497a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: md_viewer_py-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 26.6 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f71f57a3820ae73bb855533e2c3dde71707aa56a7ebd5c28ef7370ab9367f2ac
MD5 c32fef78439ddcce291ac6686afcf6d3
BLAKE2b-256 62c9acedbe47b272fc70a05b7dbbd9ac4af9cd62c38155e63230a93d7621c837

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