📝 Markdown Viewer (GitHub-Style)
A GitHub-style Markdown viewer for local docs, with file tree, search, and live reload.
A local Markdown documentation browser that:
- Renders
.mdfiles with GitHub-flavored styles - Displays a recursive file/folder tree
- Supports live plain-text filtering (client-side)
- Supports filename/content search using
fdorrg - 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.
🧭 Idea & Architecture
mdviewer turns a local folder of Markdown files into a browsable documentation
site with one command. The files remain the source of truth: the Python server
discovers and renders them, while the browser provides navigation, search, and
reading tools.
flowchart LR
User["Reader / author"] --> CLI["mdv PATH<br/>target · port · browser"]
subgraph Server["Local Python server"]
Flask["Flask routes<br/>/ · /view · /search"]
Tree["File discovery<br/>recursive .md tree"]
Render["Markdown renderer<br/>Markdown → HTML"]
Search["Search adapters<br/>fd · rg"]
Reload["Live reload<br/>file watcher"]
Flask --> Tree
Flask --> Render
Flask --> Search
Flask --> Reload
end
subgraph Browser["Browser UI"]
Templates["Jinja templates"]
Client["Client JavaScript<br/>filter · history · theme"]
Document["Rendered document<br/>read · navigate · print"]
Templates --> Client
Client --> Document
end
Files[("Local Markdown folder")] --> Tree
Files --> Render
CLI --> Flask
Flask --> Templates
Render --> Document
Reload -. refresh .-> Document
flowchart TB
MDV["mdviewer<br/>local documentation browser"]
MDV --> Discover["Discover<br/>file tree · folders · live filter"]
MDV --> Find["Find<br/>filename search · content search"]
MDV --> Read["Read<br/>GitHub-style Markdown · math · footnotes"]
MDV --> Navigate["Navigate<br/>breadcrumbs · browser history"]
MDV --> Iterate["Iterate<br/>live reload · themes · PDF export"]
🚀 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 # serve the current directory and open the browser when Markdown is found
mdv .
mdv /path/to/README.md
mdv --no-open # serve without opening a browser
🚀 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 matchingrg: 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
.mdfile in browser - 🖨 Export/Print to PDF button
- 📁 Breadcrumb with Font Awesome icons
- 📄 Highlight + expand tree for active file
⏭️ Next Steps
📄 License
MIT
Metadata
Release files for mdviewer 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mdviewer-0.4.2.tar.gz | 16.5 kB | With provenance | Details for mdviewer-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mdviewer-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for mdviewer-0.4.2-py3-none-any.whl |
Total release size: 31.6 kB
Release files / mdviewer-0.4.2.tar.gz
| Download URL | mdviewer-0.4.2.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
672cf71a40c40449adb6cb7adb750ea51ca4fffc78ba259e55b853c543894ca8
|
|
BLAKE2b-256 checksum How to use checksums |
026d5b59fd50e5550af9be8acc5a90d74e9f534cd01393ea951aaeb4ae036c18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logRelease files / mdviewer-0.4.2-py3-none-any.whl
| Download URL | mdviewer-0.4.2-py3-none-any.whl |
|---|---|
| Size | 15.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ccbf5c1200ffc2b41cd614e4bf6338b1bb227224a4076c804d9029b02a8e0ab
|
|
BLAKE2b-256 checksum How to use checksums |
c743511e4761f770b04222554005d8c83d469f06ea146baa82f1ab9ca8a4d195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logSecurity for mdviewer 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for mdviewer-0.4.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.