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 # 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 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.1.tar.gz (14.3 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.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mdviewer-0.4.1.tar.gz
  • Upload date:
  • Size: 14.3 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.1.tar.gz
Algorithm Hash digest
SHA256 73139d2e47eff8aa148200c6767dcd0c42853883fcdae6c041d112b1697dc044
MD5 228f96e973796d981536f625eff27654
BLAKE2b-256 39403ffa33965ed3f7c70173fe90fa7c77ac4a65f16eb9f7480c8b22bda28f58

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mdviewer-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d90ba5c9ff08bc69b24e26377d128de8b6c8f1e8f0cf3b24983e511902d69f50
MD5 d3debaafcb7debf68cb0734974fd62a9
BLAKE2b-256 815f63fc85b1be208920317add2f61e19d75b8343d53f0124039dd48a7b00ecc

See more details on using hashes here.

Provenance

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