Skip to main content

GitHub-style Markdown viewer

Reason this release was yanked:

0.3.0 was published before the mdv alias and version flag were included. Use 0.3.1 instead.

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.0.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.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdviewer-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 181846b83037e403ed426d2a0d9293eed2ec00c354408f2c93e5c78c9fd1e0bb
MD5 b80c1b6f12debfd00ecd25cf95c46f4d
BLAKE2b-256 fb1731fbd67ee4085b4bca7e01004c092e558fa23158bca31ef0072e0d2defd2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mdviewer-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 140b5e711a538d4f893de6039a189284a18e3307022888a477960f7dc55a4f01
MD5 d9efff77e1fd48ae142f12174eebb225
BLAKE2b-256 0464592878d77800bec183849483ce23666747c8c7d9ef800f911c6de3636f25

See more details on using hashes here.

Provenance

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