Markdown preview with live reload.
go install github.com/arclabs561/mdpreview@v0.1.0
mdpreview README.mdOr without installing:
go run github.com/arclabs561/mdpreview@v0.1.0 README.mdOpens a local server at http://127.0.0.1:8080 with GitHub-accurate rendering. The page updates automatically when the file changes on disk, highlighting what changed.
mdpreview . # serve current directory
mdpreview -addr :3000 README.md # custom port
mdpreview -no-open README.md # don't open browserView rendered markdown changes side by side (HEAD vs working copy):
mdpreview diff README.md # opens browser with side-by-side view
mdpreview diff -o diff.png README.md # save as screenshotThe live preview also shows diff indicators: fading highlights on each
edit, a git diff gutter for uncommitted changes, and +N / -N stats
in the header.
Capture rendered pages as images (requires Chrome/Chromium):
mdpreview screenshot README.md # single file -> README.png
mdpreview screenshot -o shot.png README.md # explicit output
mdpreview screenshot -dark README.md # force dark mode
mdpreview screenshot -light README.md # force light mode
mdpreview screenshot . # directory -> one PNG per .md
mdpreview screenshot -concat . # directory -> one tall imageExport to PDF:
mdpreview pdf README.md # -> README.pdf
mdpreview pdf -o out.pdf README.md # explicit output- GFM via goldmark (tables, task lists, strikethrough, autolinks)
- Syntax highlighting via Shiki with
github-light/github-darkthemes - Math via KaTeX (
$inline$and$$block$$) - GitHub alerts (
> [!NOTE],> [!WARNING],> [!TIP],> [!IMPORTANT],> [!CAUTION]) - Mermaid diagrams
- Colors from Primer design tokens with system dark mode detection
Rebuild the client bundle after editing client/main.ts:
make client # requires bun or npm
make build # or just: make