A small Windows utility that opens .md files in a native window and renders
them the way GitHub does. Switch between Rendered, Raw, and Edit
modes with one click. Edits save back to the original file.
- GitHub-flavored Markdown (tables, task lists, strikethrough, footnotes, fenced code)
- Pygments syntax highlighting
- Light + dark themes (auto-detects system, toggleable)
- Lives in a single Python file plus three asset files — no Electron, no bundle
- Uses Edge WebView2 (already on Windows 11), so the window is light
install.batInstalls pywebview, markdown-it-py, mdit-py-plugins, linkify-it-py, and Pygments.
register.batRegisters the viewer for .md, .markdown, .mdown, and .mkd under
HKCU\Software\Classes (no admin required) and clears Windows' UserChoice
override so double-click opens this app.
If Windows still opens .md with a different app:
- Right-click any
.mdfile - Open with → Choose another app
- Pick Markdown Viewer and tick Always use this app
To revert:
unregister.batpython viewer.py path\to\file.md| Shortcut | Action |
|---|---|
Ctrl+1 |
Rendered view |
Ctrl+2 |
Raw view |
Ctrl+3 |
Edit view |
Ctrl+S |
Save (in Edit mode) |
Toolbar buttons: 📂 reveals the file in Explorer, 🌓 toggles theme.
markdown-viewer/
├── viewer.py main app + pywebview bridge
├── requirements.txt
├── install.bat
├── register.bat binds .md → this viewer (HKCU)
├── unregister.bat
└── assets/
├── github.css GitHub markdown styles (light + dark)
├── app.css toolbar, tabs, panes
└── app.js tab switching, save, theme
- Registration is per-user (
HKCU). No UAC prompt. - The viewer trusts the file content (
html: falsein markdown-it) — raw HTML in.mdfiles is escaped, matching GitHub's default behaviour. - Edit mode preserves Unix line endings on save.