Skip to content

Repository files navigation

md-view-win

A fast, lightweight Markdown preview app for Windows 10/11, built with Tauri 2.

Open any .md file → get a clean, faithful preview → export to PDF in one click. No Electron bloat and no network required: math, diagrams, and syntax highlighting all work fully offline.

This is a Windows port of the macOS app pluk-inc/markdown-preview, rebuilt from scratch with React 19 + TypeScript on WebView2. The render pipeline mirrors the macOS original module by module, so the output stays faithful to it.

中文说明

Platform Tauri License

Features

  • Open local Markdown files (.md / .markdown / .mdown / .mkd / .mkdn / .mdx), with drag & drop
  • Full rendering: GFM tables, task lists, footnotes, YAML/TOML frontmatter cards, ==highlight==
  • Math (KaTeX), diagrams (Mermaid with zoom), code highlighting — all offline
  • RTL (Arabic / Hebrew / …) paragraph direction inference, light/dark follows the system
  • One-click PDF export (via the system print dialog → Save as PDF)

Install (end users)

Build the installer on a Windows machine (requires the Rust toolchain):

winget install Rustlang.Rustup
# after restarting the terminal:
cargo install tauri-cli
cd md-view-win
cargo tauri build

Artifacts land in src-tauri/target/release/bundle/: distribute the installer from msi/ or nsis/ (it registers .md file associations, Start menu entries, and uninstall). The bare md-view-win.exe under target/release/ also runs standalone, but is not recommended for distribution.

Note: user machines need the WebView2 Runtime, preinstalled on Win11 and recent Win10. An unsigned build triggers a SmartScreen "unknown publisher" prompt on first install — expected.

Develop

Frontend and rendering work on Linux directly, no Rust needed:

npm install
npm run dev      # Vite dev server; file open falls back to <input type=file> outside Tauri
npm test         # vitest: unit + snapshot regression tests
npx tsc --noEmit # typecheck (keep clean before committing)
npm run build    # frontend-only build (NOT tauri build)

public/samples/ holds 9 sample documents copied from the macOS app — open each in npm run dev for render comparison; UPDATE_SNAPSHOTS=1 npm test refreshes snapshots after intentional render changes.

Tech stack

Layer Choice
Shell Tauri 2 (WebView2 on Windows)
Frontend React 19 + TypeScript + Vite
Markdown parsing markdown-it (html:false, linkify:true, typographer:false, matching macOS behavior)
Math / diagrams / highlighting / sanitizing KaTeX 0.16.45, Mermaid 11.14.0, highlight.js 11.10.0, DOMPurify (offline bundles in public/vendor, lazily loaded, never in the main bundle)
Backend Minimal Rust shell (file-dialog + file-read plugins, no custom commands)

The render pipeline (src/renderer/) mirrors macOS MarkdownHTML module by module: frontmatter → footnote extraction → math extraction → markdown-it → Mermaid post-process → math restore → footnote rendering → heading IDs → task lists → RTL. See CLAUDE.md.

Not yet supported (beyond MVP)

Edit mode, in-page search, outline sidebar, custom themes, autosave / file watching, recent files, auto-update, HTML/PNG export, localized UI.

Support

If this app saves you time, you can buy me a coffee ☕

Buy Me a Coffee QR code

Credits

License

Code is MIT licensed (same as upstream); third-party assets under public/vendor/ keep their own licenses.

About

Lightweight Markdown preview for Windows — open .md, render beautifully, export to PDF. Offline KaTeX, Mermaid & syntax highlighting. Tauri 2 port of the macOS Markdown Preview app.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages