A Python application to view Markdown files as rendered HTML in your system browser or a native GUI window.
- View single or multiple Markdown files simultaneously
- Opens in system browser by default (no extra dependencies needed)
- Native GUI window using PyWebView via
-g/--guiflag (optional) - Convert Markdown files to HTML with syntax highlighting and table support
- Multi-file browser mode creates an index page with links
- Multi-file GUI mode provides a tabbed interface
- Support for common Markdown extensions (tables, code highlighting, etc.)
- Option to keep generated HTML files or auto-delete after viewing
Download and run the self-contained installer:
# Download the installer
curl -O https://raw.githubusercontent.com/richardahasting/mdview/main/mdview_installer.py
# Run the installer
python3 mdview_installer.pyThe installer will:
- Detect your system and package manager (pip/pipx)
- Check for existing installations
- Install to your preferred location
- Add mdview to your PATH
- Clone or download this repository
- Install dependencies:
pip install -r requirements.txtFor GUI mode support (optional):
pip install pywebviewpython mdview.py your_file.mdpython mdview.py -g your_file.mdpython mdview.py file1.md file2.md file3.mdpython mdview.py -g file1.md file2.md file3.mdmarkdown_files: Path(s) to the markdown file(s) to view (accepts multiple files)-g,--gui: Open in native GUI window using PyWebView (requires pywebview)-k,--keep: Keep the HTML file(s) instead of auto-deleting after viewing-r,--readme: Display this README.md file-h,--help: Show help message and exit
-
MDVIEW_CLEANUP_DELAY: Time in seconds to wait before deleting temporary HTML files (default: 30). Increase this if your browser is slow to load files before they are cleaned up.# Example: Wait 60 seconds before cleanup export MDVIEW_CLEANUP_DELAY=60 mdview README.md
View a single file in browser (default):
python mdview.py README.mdView multiple files with an index page:
python mdview.py docs/*.mdOpen in native GUI window:
python mdview.py -g README.mdKeep the generated HTML files:
python mdview.py -k report.md
# Creates report.html in current directoryView the built-in README:
python mdview.py -r
# or in GUI window
python mdview.py -r -g- markdown: For converting Markdown to HTML
- pywebview (optional): For native GUI window display
To build the self-contained installer:
bash build.shThis will:
- Generate the
mdview_installer.pywith embedded source code - Create distribution packages
- Run tests to verify functionality
This project is open source and available under the Apache License 2.0.