{"id":48698938,"url":"https://github.com/vorojar/md-preview","last_synced_at":"2026-05-29T13:00:38.712Z","repository":{"id":350586187,"uuid":"1207497190","full_name":"vorojar/md-preview","owner":"vorojar","description":"Small native Markdown preview app built with Rust + system WebView. No Electron. GFM, syntax highlighting, KaTeX, Mermaid, live reload.","archived":false,"fork":false,"pushed_at":"2026-05-28T00:28:07.000Z","size":6734,"stargazers_count":125,"open_issues_count":2,"forks_count":10,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-28T02:20:20.039Z","etag":null,"topics":["cross-platform","dark-mode","developer-tools","gfm","lightweight","macos","markdown","markdown-preview","markdown-viewer","native-app","offline","rust","syntax-highlighting","webview","wry"],"latest_commit_sha":null,"homepage":"https://vorojar.github.io/md-preview/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vorojar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-11T02:34:26.000Z","updated_at":"2026-05-28T01:44:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vorojar/md-preview","commit_stats":null,"previous_names":["vorojar/md-preview"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/vorojar/md-preview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorojar%2Fmd-preview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorojar%2Fmd-preview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorojar%2Fmd-preview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorojar%2Fmd-preview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vorojar","download_url":"https://codeload.github.com/vorojar/md-preview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vorojar%2Fmd-preview/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33652986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-29T02:00:06.066Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","dark-mode","developer-tools","gfm","lightweight","macos","markdown","markdown-preview","markdown-viewer","native-app","offline","rust","syntax-highlighting","webview","wry"],"created_at":"2026-04-11T09:13:50.192Z","updated_at":"2026-05-29T13:00:38.706Z","avatar_url":"https://github.com/vorojar.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MD Preview\n\n**English · [简体中文](README_zh.md)**\n\n[![GitHub stars](https://img.shields.io/github/stars/vorojar/md-preview)](https://github.com/vorojar/md-preview/stargazers)\n[![Release](https://img.shields.io/github/v/release/vorojar/md-preview)](https://github.com/vorojar/md-preview/releases)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Windows%20%7C%20Linux-lightgrey)](https://github.com/vorojar/md-preview/releases)\n[![Binary size](https://img.shields.io/badge/binary-~5MB-green)](https://github.com/vorojar/md-preview/releases)\n\n\u003e A native Markdown previewer for AI-generated docs, README files, plans, Mermaid diagrams, and technical notes. Open the file now, not a whole IDE.\n\nMD Preview is a fast, local-first Markdown viewer built with **Rust** and the system **WebView**. It does not bundle Chromium, does not require Electron, and keeps all rendering assets offline. Drop in a Markdown file, open one from the terminal, or keep it beside Cursor, Claude Code, Codex, VS Code, Vim, Zed, or any editor that writes Markdown.\n\n![MD Preview screenshot](https://raw.githubusercontent.com/vorojar/md-preview/master/screenshots/hero.jpg)\n\n## Why It Exists\n\nAI coding tools now generate a lot of Markdown: `README.md`, `plan.md`, task specs, architecture notes, changelogs, KaTeX formulas, and Mermaid diagrams. Most Markdown tools are still either full writing studios or editor plugins. MD Preview is deliberately smaller:\n\n- **Open fast** - native binary, system WebView, no bundled browser runtime.\n- **Stay local** - Markdown, syntax highlighting, math, and diagrams render on your machine.\n- **Follow your editor** - save the file in Vim, VS Code, Cursor, Zed, or anything else; the preview refreshes automatically.\n- **Keep reading clean** - the toolbar only appears on hover, so the document stays the focus.\n- **Handle real Markdown** - code blocks, tables, task lists, math formulas, Mermaid diagrams, images, links, and print all work offline.\n\n## Fits AI Coding Workflows\n\nUse it as a small read-only window next to the tools that generate or edit your docs:\n\n- Preview Claude Code / Codex / Cursor-generated plans without opening a full IDE.\n- Keep Mermaid and KaTeX docs readable while your editor stays in source mode.\n- Review local project notes, specs, and README drafts with live reload.\n- Print or export the rendered preview when you need a clean PDF.\n\n## Download\n\nGet the latest build from [GitHub Releases](https://github.com/vorojar/md-preview/releases).\n\n| Platform | Package | Notes |\n|---|---|---|\n| macOS | `MD-Preview-macOS-universal.dmg` | Universal app for Apple Silicon and Intel. Releases are signed and notarized. |\n| Windows | `MD-Preview-windows-x64.zip` | Includes a GUI executable with the app icon embedded. |\n| Linux | `MD-Preview-linux-x64.tar.gz` | Requires the system WebKitGTK runtime. |\n\nYou can also build from source:\n\n```bash\ngit clone https://github.com/vorojar/md-preview.git\ncd md-preview\ncargo build --release\n./target/release/md-preview README.md\n```\n\nTo create the macOS `.app` bundle locally:\n\n```bash\nchmod +x bundle.sh\n./bundle.sh\ncp -r \"target/MD Preview.app\" /Applications/\n```\n\n## Usage\n\n```bash\n# Open a file directly\nmd-preview README.md\n\n# Or launch an empty window and drag in a file\nmd-preview\n```\n\nMD Preview accepts `.md` and `.txt` files through drag and drop, the open dialog, or the command line. Relative images are resolved from the Markdown file's directory, so local documentation folders render naturally.\n\n## Features\n\n| Feature | What it means |\n|---|---|\n| Drag and drop | Drop a Markdown file into the window and it opens immediately. |\n| CLI open | `md-preview path/to/file.md` opens directly from a shell. |\n| Live reload | External edits refresh the rendered document automatically. |\n| Inline source edit | `Cmd/Ctrl+E` switches to source mode for quick edits; `Cmd/Ctrl+S` saves. |\n| Native print | `Cmd/Ctrl+P` opens the platform print dialog and prints only the preview. |\n| Syntax highlighting | highlight.js is embedded offline and injected after first paint. |\n| Math | KaTeX renders `$...$`, `$$...$$`, `\\(...\\)`, and `\\[...\\]` on demand. |\n| Diagrams | Mermaid fenced blocks render locally when the document actually uses them. |\n| Dark mode | Follows the system color scheme across macOS, Windows, and Linux. |\n| GitHub-flavored Markdown | Tables, task lists, strikethrough, heading attributes, and anchors. |\n| External links | `http`, `https`, and `mailto` links open in the system browser or mail app. |\n| Window restore | Last size and position are restored when still visible on a connected monitor. |\n| Update check | After first paint, MD Preview checks GitHub Releases and shows a small update button if a newer version exists. |\n\n## Keyboard Shortcuts\n\n| Shortcut | Action |\n|---|---|\n| `Cmd/Ctrl + O` | Open file |\n| `Cmd/Ctrl + E` | Toggle preview/source edit |\n| `Cmd/Ctrl + S` | Save in source edit mode |\n| `Cmd/Ctrl + P` | Print preview |\n| `Esc` | Leave source edit mode and save if needed |\n\n## Markdown Support\n\nMD Preview uses `pulldown-cmark` for the base Markdown pass, then enhances the rendered document only when needed:\n\n- CommonMark plus GFM-style tables, task lists, strikethrough, and heading attributes\n- Offline code highlighting for 40+ languages, including Delphi/Pascal\n- Offline KaTeX math rendering with safeguards so Markdown emphasis does not break formulas\n- Offline Mermaid rendering for fenced ```` ```mermaid ```` blocks\n- Relative image paths through a per-file `\u003cbase\u003e` URL\n- Print CSS that removes app controls from printed output\n\nThe cold path stays small: regular Markdown renders first, while heavier enhancers such as highlight.js, KaTeX, and Mermaid are deferred until after the first visible paint or loaded only for documents that need them.\n\n## How It Stays Small\n\nMD Preview is not a Tauri or Electron app. It uses:\n\n- **Rust** for the native shell and Markdown pipeline\n- **wry** for the system WebView: WebKit on macOS, WebView2 on Windows, WebKitGTK on Linux\n- **tao** for the cross-platform window/event loop\n- **pulldown-cmark** for Markdown parsing\n- **notify** for file watching\n- **rfd** for native open dialogs\n\nThe release profile enables size-oriented optimization, LTO, one codegen unit, symbol stripping, and `panic = \"abort\"`.\n\n## Privacy\n\nMD Preview has no accounts, no telemetry, and no analytics. Your Markdown files stay on disk. Rendering happens locally. The only network request made by the app itself is the optional GitHub Releases update check after the first paint; failed checks are ignored and never block startup.\n\n## Troubleshooting\n\n**Linux does not launch**\n\nInstall WebKitGTK 4.1 packages for your distribution. On Debian/Ubuntu:\n\n```bash\nsudo apt-get install libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev\n```\n\n**Windows cannot set MD Preview as the default app automatically**\n\nWindows does not allow apps to silently take over file associations. MD Preview registers itself in the \"Open with\" list; choose it from Explorer or Windows Settings.\n\n**A formula or diagram shows as text**\n\nMake sure the syntax is valid Markdown/KaTeX/Mermaid. Math and Mermaid are loaded on demand, so documents without those patterns do not pay the startup cost.\n\n## Development\n\n```bash\ncargo build\ncargo test\ncargo build --release\n```\n\nCI builds macOS, Windows, and Linux. Release tags matching `v*` produce a macOS DMG, Windows ZIP, and Linux tarball through GitHub Actions.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorojar%2Fmd-preview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvorojar%2Fmd-preview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvorojar%2Fmd-preview/lists"}