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
  • โœ… 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.3.1.tar.gz (13.0 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.3.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for mdviewer-0.3.1.tar.gz
Algorithm Hash digest
SHA256 98cf74ddc8b3b75f9de00ac012f5110fa7937bd928728201fd00b25c9b1d1e42
MD5 894aa74ce8ce129abb06cfa17d84dc8e
BLAKE2b-256 3acee28a3de27afedb03691337897efe96a370b1e0155d0a740be3673089bef1

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdviewer-0.3.1.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.3.1-py3-none-any.whl.

File metadata

  • Download URL: mdviewer-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 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.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e660e255b3e44d00e0b907668d20e353eeaeb880eee1f2e2d84b13f0779ed81e
MD5 a89f4bce7a2a8dc70bb97d7406a26d82
BLAKE2b-256 25e6db4c1949e0ea1738e7fb7d8df4e532c8be860ac90eb3f9871af7a1ba9e58

See more details on using hashes here.

Provenance

The following attestation bundles were made for mdviewer-0.3.1-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