Turn any local Markdown file into a styled browser page with one command.
View the rendered Markdown demo. Try the live Mermaid editor.
Repository: github.com/rikby/mdopen
Latest release: github.com/rikby/mdopen/releases/latest
Write Markdown. Run
mdopen. Read, tune, and print it in your browser.
mdopenis for quick local previews when a plain Markdown file needs to look like a finished document.
flowchart LR
A[Write file.md] --> B[Run mdopen file.md]
B --> C[Styled HTML opens in browser]
C --> D[Choose theme, font, color, and spacing]
C --> E[Print or save as PDF]
mdopen file.mdThe generated HTML is written to a temporary directory and opened with the platform default browser. No server, project setup, or manual export step is required.
- GitHub Markdown styling from cdnjs
- Round light / dark icon toggle
- Themes: default, demo, Read the Docs
- Gray levels: default, black, graphite, slate, ash
- Color accents: default, none, blue, sage, rose; each color uses varied heading and block tones
- Font sets: source, system, balanced docs, print serif, technical, editorial, product, mono
- Gap controls: normal,
-1,-2,-3 - Mermaid fenced diagram rendering with fullscreen button
- Theme-aware Mermaid diagram surfaces
- Print-specific CSS for tighter output
-3is the most compact print mode
Theme, font, tone, color, and gap are available in the hamburger menu as visible button groups.
The Source font button previews and preserves the selected theme's native heading font.
The pin icon in the menu corner controls whether outside clicks close the hamburger menu.
Default tone and color preserve the selected theme colors.
Select None to remove the color accent. Dark mode is for screen reading only; print output stays light.
Print grayscale tones use flat neutral RGB values so near-black text stays clean on color laser printers.
- macOS, Linux, Windows, or MinGW/Git Bash
bun- installed packages from this package, including
markdown-itandhighlight.js
Check:
bun --versionSee ARCHITECTURE.md for the runtime flow, source layout, and component responsibilities.
The Pages workflow renders README.md to _site/index.html, renders examples/demo.md to _site/demo.html, and deploys both from GitHub Actions.
Local preview build:
bun run build:pagesThen open _site/index.html or _site/demo.html.
In GitHub, set Pages source to GitHub Actions under repository settings. Pages deploys on pushes to main and can also be run manually from the Pages workflow.
bin/mdopen.js cross-platform Bun CLI
bin/mdopen macOS/Linux/MinGW shell launcher
bin/mdopen.cmd Windows Command Prompt launcher
bin/mdopen.ps1 PowerShell launcher
renderer.js Bun + markdown-it + highlight.js renderer
assets/ CSS, theme sources, and font assets
templates/ HTML template source
MinGW/Git Bash is supported through the shell launcher. Native Windows shells can use bin\mdopen.cmd or bin\mdopen.ps1.
Standalone binaries are published on the latest release.
Available release files:
mdopen-darwin-x64mdopen-darwin-arm64mdopen-linux-x64mdopen-linux-arm64mdopen-linux-x64-muslmdopen-linux-arm64-muslmdopen-windows-x64.exemdopen-windows-arm64.exe
Build a standalone binary for the current platform:
bun run build:binaryGitHub Actions builds release artifacts for macOS x64/arm64, Linux x64/arm64, Linux musl x64/arm64, and Windows x64/arm64.
See docs/binaries.md for binary packaging and release details.