Skip to main content

GitHub-style Markdown viewer

Project description

๐Ÿ“ Markdown Viewer (GitHub-Style)

PyPI Homebrew License: MIT PyPI Downloads

A GitHub-style Markdown viewer for local docs, with file tree, search, and live reload.

A local Markdown documentation browser that:

  • Renders .md files with GitHub-flavored styles
  • Displays a recursive file/folder tree
  • Supports live plain-text filtering (client-side)
  • Supports filename/content search using fd or rg
  • Auto-reloads edited files
  • Dark/light mode toggle
  • Export/Print to PDF
  • Breadcrumb navigation with folder/file icons
  • Highlights current file in tree and auto-expands

๐Ÿ” Preview

mdviewer opens a clean, local browser UI to view Markdown files โ€” with a collapsible file tree, file filtering, fuzzy search, and full-text content search built in.

Screenshot showing file tree and search

๐Ÿš€ Installation

๐Ÿ”ง Option 1: Homebrew (macOS/Linux)

brew tap biaojiang/mdviewer
brew install biaojiang/mdviewer/mdviewer

๐Ÿ Option 2: Python (via pip)

pip install mdviewer

Optionally add an alias:

echo 'alias mdv="mdviewer"' >> ~/.zshrc
source ~/.zshrc
# or symlink
sudo ln -s $(which mdviewer) /usr/local/bin/mdv

๐Ÿ”ง Option 3: Build from Source

# Install Python deps
pip install -r requirements.txt

# Optional: use a venv
python -m venv .venv
source .venv/bin/activate

# Install tools if needing advanced search
brew install fd ripgrep
# or
sudo apt install fd-find ripgrep

# โ–ถ๏ธ Run the Server
python app.py

Open [http://127.0.0.1:5000](http://127.0.0.1:5000/) in your browser.

๐Ÿ› ๏ธ Usage

mdviewer [PATH] or mdv [PATH]

# e.g.:
mdv # to start in current directory, there will be a warning if no README.md found
mdv .
mdv /path/to/README.md
mdv 

๐Ÿš€ Features

  • โœ… GitHub-style rendering via markdown-it-py + GitHub CSS
  • โœ… Footnote references with links to definitions and return links
  • โœ… Auto-expandable file tree using <details>
  • โœ… Live filtering with reset button
  • โœ… Backend-powered search:
    • fd: fuzzy filename matching
    • rg: content search
  • โœ… Flask-based local webserver
  • โœ… MathJax support for LaTeX
  • โœ… Reload current buffer on changes (with livereload)
  • โœ… Font Awesome icons for folders/files
  • โœ… Breadcrumb that reflects navigation path
  • โœ… Highlight + auto-expand tree for active file
  • โœ… PDF/Print export button with clean print CSS

๐Ÿ“ File Structure

.
โ”œโ”€โ”€ docs
โ”‚   โ””โ”€โ”€ math
โ”‚       โ””โ”€โ”€ math-test.md
โ”œโ”€โ”€ pyproject.toml
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ screenshot.png
โ””โ”€โ”€ src
    โ”œโ”€โ”€ mdviewer
    โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”œโ”€โ”€ app.py
    โ”‚   โ”œโ”€โ”€ cli.py
    โ”‚   โ”œโ”€โ”€ search
    โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
    โ”‚   โ”‚   โ”œโ”€โ”€ __pycache__
    โ”‚   โ”‚   โ”œโ”€โ”€ fd_search.py
    โ”‚   โ”‚   โ””โ”€โ”€ rg_search.py
    โ”‚   โ”œโ”€โ”€ static
    โ”‚   โ”‚   โ”œโ”€โ”€ script.js
    โ”‚   โ”‚   โ””โ”€โ”€ style.css
    โ”‚   โ””โ”€โ”€ templates
    โ”‚       โ”œโ”€โ”€ index.html
    โ”‚       โ”œโ”€โ”€ search.html
    โ”‚       โ””โ”€โ”€ viewer.html
    โ””โ”€โ”€ 

๐Ÿ” Search Modes

  • fd: fuzzy filename match (fast)
  • rg: full-text content match (powerful)

โš™๏ธ Keyboard & UI

  • ๐ŸŒ“ Dark/light toggle
  • โŒจ๏ธ Live tree filter with reset
  • ๐Ÿ—‚ Expandable nested folders
  • ๐Ÿ”— Click to render .md file in browser
  • ๐Ÿ–จ Export/Print to PDF button
  • ๐Ÿ“ Breadcrumb with Font Awesome icons
  • ๐Ÿ“„ Highlight + expand tree for active file

โญ๏ธ Next Steps


๐Ÿ“„ 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

mdviewer-0.4.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

mdviewer-0.4.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file mdviewer-0.4.0.tar.gz.

File metadata

  • Download URL: mdviewer-0.4.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mdviewer-0.4.0.tar.gz
Algorithm Hash digest
SHA256 20aea85aa0621b1b86a3fe27a61b58758aa520d94127eff8cb1d68aedc79561e
MD5 95f18928d79f55ba00ceb497c7ecbed2
BLAKE2b-256 784d91519fb9ce75c5c37ac8d88d59df964a8cf71eb2ece3a575e002e9d32d70

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdviewer-0.4.0.tar.gz:

Publisher: python-publish.yml on biaojiang/mdviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mdviewer-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mdviewer-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mdviewer-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a1f2196fc951989717d0c449dbab6636b419f5667492cc9bcb53ad13eeff3295
MD5 0ad887f9d0aed0f5427a233065b4c489
BLAKE2b-256 83e08a954b9d4bc93b0bc12b21275a24e14ae5a5166216ecb1b1da143a85fe64

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdviewer-0.4.0-py3-none-any.whl:

Publisher: python-publish.yml on biaojiang/mdviewer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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