A Python application to view Markdown files as rendered HTML in a native GUI window or web browser.
- View single or multiple Markdown files simultaneously
- Native GUI window using PyWebView (when installed)
- Fallback to web browser if GUI dependencies are not available
- Convert Markdown files to HTML with syntax highlighting and table support
- Multi-file support with tabs in GUI mode
- Multi-file browser mode creates an index page with links
- 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/your-repo/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 but recommended):
pip install pywebviewpython mdview.py your_file.mdpython mdview.py -b your_file.mdpython mdview.py file1.md file2.md file3.mdpython mdview.py -b file1.md file2.md file3.mdmarkdown_files: Path(s) to the markdown file(s) to view (accepts multiple files)-b,--browser: Force browser mode instead of GUI-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 in browser mode (default: 30). Increase this if you experience issues with files being deleted before your browser can load them.# Example: Wait 60 seconds before cleanup export MDVIEW_CLEANUP_DELAY=60 mdview -b README.md
View a single file in GUI:
python mdview.py README.mdView multiple files with tabs:
python mdview.py docs/*.mdForce browser mode:
python mdview.py -b README.mdKeep the generated HTML files:
python mdview.py -b -k report.md
# Creates report.html in current directoryView the built-in README:
python mdview.py -r
# or in browser
python mdview.py -r -b- 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.