A native, lightweight, WYSIWYG Markdown editor.
Muffin is a block-level WYSIWYG Markdown editor built from the ground up in C++ and Qt 6. Your Markdown file stays the single source of truth, rendered as a page you edit directly: no split panes, no preview pane, no typing lag.
Download · Features · Build from source · Architecture
Translations: 中文
- Native, not a web app — A real C++/Qt desktop application. No bundled Chromium, no Node runtime, no web stack — just a fast cold start and a small memory footprint.
- Opens huge files instantly — A lazy, viewport-aware layout renders only the blocks on screen, so multi-megabyte documents open without freezing. Incremental parsing and text-delta editing keep typing responsive at any size.
- True WYSIWYG editing — Write and edit directly on the rendered page, with the Markdown kept in sync underneath. No side-by-side preview, no render delay.
- Markdown as the source of truth — Your
.mdfile round-trips cleanly, and a synchronized source mode lets you drop into raw Markdown anytime with full cursor round-tripping between the two views. - Themeable end to end — One theme definition drives the rendered page, the source editor, and every piece of chrome (menus, sidebar, dialogs, status bar). The built-in themes are authored as plain CSS, and you can drop in your own
.css(or.json) theme.
Muffin combines a native C++/Qt editor with a broad, fully editable Markdown runtime. Velotype and Ferrite are strong native Rust alternatives; Muffin's distinction is the depth of its document engine: lazy and incremental layout, end-to-end CSS themes, native Mermaid and math rendering, and direct editing of HTML, tables, code, and diagrams. The table compares the projects' documented capabilities; it is not a cross-app benchmark.
| Muffin | Velotype | Ferrite | Typora | MarkText | Obsidian | |
|---|---|---|---|---|---|---|
| Core technology | C++ / Qt 6 | Rust / GPUI | Rust / egui | Electron | Electron | Electron |
| Open source | ✅ | ✅ | ✅ | ❌ | ✅ | ❌ |
| Native desktop UI | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Rendered WYSIWYG editing | ✅ | ✅ | ✅ | ✅ | ✅ | ◐ |
| Lazy / incremental document layout | ✅ | ◐ | ◐ | — | — | — |
| End-to-end CSS themes | ✅ | ◐ JSONC tokens | ◐ themes | — | — | — |
| Native Mermaid diagrams | 38 IDs | — | 11 IDs | — | — | — |
| Math blocks / renderer | Native C++ / KaTeX-compatible | Native Rust / RaTeX | — (planned) | MathJax | KaTeX | MathJax |
| Export | PDF, HTML, PNG; more via Pandoc | HTML, PDF | HTML, PDF | PDF, HTML, images; more via Pandoc | HTML, PDF | HTML, PDF |
| Large files | ✅ |
Muffin and Typora both require a separate Pandoc installation for formats such as Word, OpenDocument, RTF, EPUB, and LaTeX. See Typora's export documentation.
xychart-beta
title "Muffin Markdown time to first rendered viewport"
x-axis "Document size (MiB)" [25, 50, 75, 100]
y-axis "Open to first rendered viewport (s)" 0 --> 40
line [7.60, 15.60, 35.00, 34.40]
The curve measures the time from opening the Markdown file until the first viewport has finished text layout and is visible.
Obsidian's Live Preview blends rendered Markdown with raw syntax rather than offering true inline WYSIWYG.
- Live WYSIWYG editing — Write and edit directly in the rendered view. No split panes, no preview delay.
- Source mode — Toggle to a syntax-highlighted raw Markdown editor with full cursor synchronization between views.
- Focus mode (
F8) — Dim all blocks except the active one, so you can concentrate on what you're writing. - Typewriter mode (
F9) — Keep the cursor vertically centered with smooth animated scrolling that feels like paper. - Smart punctuation — Curl straight quotes, turn
--/---into en/em dashes, and...into an ellipsis as you type. An optional render-only mode beautifies punctuation without touching your Markdown source. - Extended Markdown — GitHub-style alerts (
[!NOTE],[!TIP],[!WARNING], …),==highlight==,~subscript~,^superscript^, Setext headings, and\[ ... \]LaTeX math blocks. - Spell checking — Nuspell-powered spell checking with misspelling underlines in both render and source modes, a right-click suggestion menu, ignore-word support, and bundled dictionaries for 11 languages.
- Emoji autocomplete — Type
:followed by a shortcode to open a popup emoji picker backed by a bundled dataset, then accept withTab; enabled by default while typing. - Editable tables — Add, resize, align, and delete rows and columns inline. Insert tables via a configurable dialog.
- Editable code blocks — Inline editing with syntax highlighting for 20+ languages via tree-sitter. Set the language from an autocomplete dropdown. Code Tools add line-by-line indent/dedent and a copy-block-content action.
- Editable math blocks — Write LaTeX expressions rendered live by a full KaTeX-compatible engine written in C++, with a dual-pane edit/preview layout. Supports user-defined macros, braket notation, commutative diagrams, and a one-click "Refresh All" to re-render every formula.
- Native Mermaid diagrams — Render all 38 Mermaid 11.16 diagram IDs, including flowchart/Flowchart ELK's bundled Dagre fallback, Swimlane, sequence, class, state, ER, requirement, pie, quadrant, journey, radar, XY, timeline, packet, Kanban, mindmap, Block, GitGraph, C4, TreeView, Event Modeling, Ishikawa, Venn, Sankey, Treemap, Cynefin, Wardley, Architecture, Gantt, Info, and the Railroad/EBNF/ABNF/PEG grammar family, live from
```mermaidfences through a pure C++/Qt engine with no JavaScript or browser runtime dependency. Invalid source stays editable with exact line/column diagnostics, an in-source error marker, and click-to-jump navigation. Shared title/accessibility metadata, rounded flow routes, safe links and tooltips, live animated edges, Sequence link menus, deterministic native SVG/HTML export, a per-diagram context-menu SVG/PNG save, amuffin-mmdcheadless CLI for batch rendering, and a generated 533-row configuration-effect matrix keep editor and export behavior explicit. - Editable HTML blocks — Edit raw HTML blocks inline with Lexbor-based parsing and Yoga-based flexbox layout, themed to match the active document.
- Footnotes & link definitions — Full support for footnote (
[^id]: text) and link reference definitions with rendering, editing, and insertion commands. - Front matter — Full YAML front matter support.
- Rich paragraph commands — Toggle headings, code fences, math blocks, and more from the paragraph menu.
- Block movement — Move paragraphs up and down with keyboard shortcuts.
- Configurable indent — Choose the default indent size (2/4/8 spaces), with an optional "Align Indent" command to match surrounding indentation.
- Find & replace — Built-in search bar with regex support, wrap-around, and replace/replace-all.
- Multi-format copy — Copy selected content as Markdown, HTML, or plain text.
- Copy as Markdown — Optional preference to copy the underlying Markdown source when copying as plain text.
- Whole-line copy & cut — With no selection, copy and cut operate on the entire current line.
- Link interaction — Hover cursor changes on links; Ctrl+Click to open in the system browser.
- Line break rendering — Render a single newline as a hard line break, or join soft-wrapped lines into one paragraph per CommonMark, controlled by a Markdown preference. Hard
<br>line breaks render and edit in all three forms (<br>,<br/>,<br />). - Line break preferences — Choose Windows (CRLF) or Unix (LF) line endings, with an optional trailing newline on save.
- Document outline — Jump to any heading from the sidebar outline, with collapsible subtrees for long documents.
- Heading badges — Visual level badges (H3–H6) painted alongside headings for quick hierarchy identification.
- File tree sidebar — Browse and open files from a folder tree. A compact toolbar creates files and folders, refreshes the tree, sorts by name, modification/creation date, type or size, and collapses all directories. Sort preferences are remembered, with folders always listed first. Close the workspace from the tree's context menu.
- Quick Open —
Ctrl+Precursively searches text files in the open folder by file name, relative path, multiple terms, or ordered characters, with visible paths for duplicate names. Without a folder, choose from open and recent files. - Folder search & replace — Click the file toolbar's magnifier or press
Ctrl+Shift+Fto search contents with grouped source lines and context, selecting ordinary text in live editing and temporarily showing hidden syntax in source mode. Click the magnifier again or the Files tab to return to the tree without losing results.Ctrl+Shift+Hopens replacement controls, followed by a preview with selectable files. Unsaved or conflicting files are skipped, with original-byte backups available for recovery after restart. - File operations — Move, delete, reveal in file manager, reopen-with-encoding, and save-all-open-files from the file menu.
- Document tabs — The tab bar appears when two or more documents are open and hides when only one remains. Each document keeps its own unsaved content, undo history, view mode, and cursor/scroll position. Drag to reorder, use Ctrl+N to add a tab, Ctrl+Tab / Ctrl+Shift+Tab to switch, and Ctrl+W or middle-click to close.
- Session restore — By default, reopen the tabs, active file, workspace, and expanded folders left at exit, including each tab's view mode, cursor, selection, and reading position. Reading positions use source anchors to handle rewrapping. Explicitly closed files and folders stay closed; closing everything starts a blank editor next time. Choose Always start fresh in Files preferences to disable restoration.
- Draft recovery — Recover unsaved work after a crash or unexpected exit.
- Autosave — Optional periodic saving and save-on-exit to protect unsaved work.
- Custom status bar — A self-painted, theme-aware status bar showing parse time, cursor position, and word count, with a click-to-open statistics popup (words, characters, lines, reading time, and selection count) and an inline spell-check language quick-switcher.
- In-app help — Quick Start, Markdown Reference, and Acknowledgements available from the Help menu in a built-in viewer rendered by the native Markdown engine, with back/forward navigation.
- Automatic update checks — Notified of new releases on startup (once per 24 hours), with a manual check from the Help menu.
- Multi-format export — Export to PDF, PNG, HTML, and plain HTML natively; Word (DOCX), ODT, RTF, ePub, LaTeX, MediaWiki, RST, Textile, and OPML via an external Pandoc process.
- Settings per format — Preferences → Export has independent settings for PDF paper, margins and heading breaks; HTML contents and additions; PNG width and scale; Word/ODT reference documents; and EPUB CSS and contents depth. Conversion failures and cancellation preserve an existing destination file.
- Import via Pandoc — Convert documents from other formats into Markdown through File → Import.
- Document printing — Print the current document via File → Print (Alt+Shift+P).
- Image editing — Insert local or network images, drag-and-drop upload, right-click context menu, preview rendering, and batch processing. WebP and AVIF formats supported, plus bundled PNG/JPEG decoders so images load reliably regardless of Qt's plugin availability.
- Image insertion policy — A centralized system governing image insertion across paste, dialog, and drag-and-drop with six configurable actions (no action, copy to
./,./assets,./<filename>.assets, upload, or a custom folder), honoring front-matter upload overrides and configurable relative-path, leading-slash, and URL-escaping formatting. - Custom-command upload — Upload images through a configurable external command, parsing its stdout lines as image URLs.
- 5 built-in themes — GitHub, Newsprint, Night, Pixyll (now with a serif body font), and Whitey.
- Custom themes — The built-in themes are authored as plain CSS, and you can author your own the same way: drop a
.css(or.json) file into the themes folder and it shows up in the live Theme menu instantly. Import themes directly from the menu or the Appearance preferences page. - Appearance preferences — Font size, zoom level, content width (theme default, comfortable, wide, or full width), focus mode, typewriter mode, and status bar visibility — all persisted across sessions.
- Always-on-top — Keep the window above all others through the View menu.
- 15 UI languages — English, 简体中文, 繁體中文, 日本語, 한국어, Tiếng Việt, Français, Español, Deutsch, Português (Brasil), Русский, Italiano, Türkçe, Polski, and Nederlands.
- Native C++/Qt — No Electron. Fast startup, low memory, and smooth scrolling.
- Lazy viewport layout — Opening a document computes only cheap height estimates for the whole file; full text shaping, syntax highlighting, math, and HTML rendering are deferred to blocks as they scroll into view. Anchor-corrected scrolling keeps the page steady while offscreen blocks are promoted, so large files open and scroll without lag.
- Incremental parsing — Only changed blocks are re-parsed and re-rendered.
- Incremental layout — Top-level block range diffing avoids full layout rebuilds on edits.
- Text delta editing — Sends incremental text updates instead of full document replacement.
| Windows | macOS | Linux | |
|---|---|---|---|
| Install | MSI | DMG | Build from source |
Windows releases also include a complete .7z portable package. Extract it and run Muffin.exe; fonts, dictionaries, and language support are bundled for offline use.
macOS ARM64 builds target macOS 13.0 and newer. See the deployment compatibility notes for the v0.7.13 packaging issue and build checks.
Muffin uses Conan for dependency management and CMake for building. You need a C++20 compiler (MSVC 2022+, GCC 12+, or Clang 15+), Qt 6 (installed via Conan), Conan 2.x, and CMake 3.24+.
# Install build-time font conversion tools
python -m pip install -r requirements-build.txt
# Detect your Conan profile
conan profile detect --force
# Install dependencies
conan install . -s build_type=Release -s compiler.cppstd=20 --build=missing
# Configure and build
cmake --preset conan-default
cmake --build --preset conan-releaseOn macOS, add -pr:h profiles/macos to conan install and configure with
cmake --preset conan-release. The profile sets the minimum OS for the complete
dependency graph; changing only an app's Info.plist cannot make newer binaries
compatible with an older OS.
ctest --preset conan-release --output-on-failure# Build the distributable bundle
cmake --build --preset conan-release --target dist
# Launch
./build/dist/Muffin # Linux / macOS
.\build\dist\Muffin.exe # WindowsSee CLAUDE.md for additional build details and common pitfalls.
cmake --build --preset conan-release --target update_translations # Extract strings
cmake --build --preset conan-release --target release_translations # Compile .qm filesMuffin uses a native block tree as its runtime model. On import, Markdown is parsed into structured, editable blocks; on save, the block tree is re-serialized into normalized Markdown. Bidirectional inline projection keeps the rendered view and the raw source mapped at all times.
| Layer | Responsibility |
|---|---|
app |
MainWindow, preferences, sidebar, quick open, and UI language management. |
editor |
The rendered editing surface, source editor, find bar, and input handling. |
render |
Layout engine and block/inline painting, driven by themes. |
document |
Markdown document model, outline, and source round-trip mapping. |
parser |
Markdown parsing via cmark-gfm, fed by incremental text deltas. |
blocks |
Per-block runtimes: code, table, math, HTML, front matter, link refs, literal. |
html |
HTML block layout engine — Lexbor parsing and Yoga flexbox used by HTML blocks. |
edit |
Text editing operations: insert, delete, replace, and block movement. |
projection |
Bidirectional offset mapping between the rendered view and raw Markdown. |
export |
Native PDF/HTML/PNG export, per-format options and the Pandoc runner for other formats. |
math |
KaTeX-compatible math rendering. |
unicode |
Word-boundary segmentation for cursor movement and selection. |
theme |
Unified theme definitions, chrome style-sheet generation, and runtime theme management. |
image |
Image insertion policy and custom-command upload. |
io |
File I/O, encoding, and image file operations. |
spellcheck |
Nuspell spell checking and bundled dictionaries. |
commands |
Command registry decoupling menu actions from their implementations. |
| Library | Purpose | License |
|---|---|---|
| Qt 6 | GUI framework | LGPL-3.0 |
| cmark-gfm | GitHub-Flavored Markdown parsing | BSD-2-Clause |
| tree-sitter | Code syntax highlighting | MIT |
| KaTeX | Math formula rendering (fonts bundled) | MIT |
| Yoga | Flexbox layout for HTML blocks | MIT |
| Lexbor | HTML parsing | Apache-2.0 |
| Nuspell | Spell checking | LGPL-3.0-or-later |
| ICU | Unicode text processing | ICU License |
| libwebp / libavif / dav1d | WebP and AVIF image decoding (libavif built from vendored source, with dav1d as its AV1 decoder) | BSD-3-Clause / BSD-2-Clause |
| libpng / libjpeg | PNG and JPEG image decoding | libpng / libjpeg |
Third-party sources live in third_party/ and are built as part of the CMake project.
Muffin already covers nearly all of core and extended Markdown — headings, paragraphs, lists, task lists, blockquotes, tables, code blocks, inline formatting, links, reference-style links and images, footnotes, front matter, math, and HTML — plus multi-format export and import. Ongoing work includes:
- Polish the rendered editor surface — selection (cross-cell table spans, themed color, triple-click, drag threshold/extend/auto-scroll), caret (blink, ghost-erase fixes), IME (full context queries, source-mode composition rendering, focus reset), and partial refresh (BuiltStamp bypass, caret dirty rects).
- Add native Mermaid flowchart, Swimlane, sequence, class, state, ER, requirement, pie, quadrant, journey, radar, XY, timeline, packet, Kanban, mindmap, Block, GitGraph, C4, TreeView, Event Modeling, Ishikawa, Venn, Sankey, Treemap, Cynefin, Wardley, Architecture, Gantt, and Info diagrams.
- Add safe Mermaid links/tooltips, live Flowchart edge animation, and Sequence participant menus.
- Add deterministic native Mermaid SVG export, including inline HTML output and single-diagram context-menu saving.
- Finish absolute SVG marker URL parity (flowchart/Swimlane/sequence serialize absolute marker references when the export context supplies a document URL; other 11.16 families keep fragment references, matching upstream).
- Continue extending GFM coverage.
- Harden performance — structured 1–100 MB parser phases scale approximately linearly; AST node bodies are now 96 B smaller each and the 100 MiB roundtrip uses about 834 MiB less resident memory. Next, reduce cmark's parse-tree peak and very-large-document layout cost.
- Accessibility — word/paragraph/page keyboard navigation, table Tab navigation, focus escape (F6 pane cycling), and QAccessible screen-reader adapters for both editor canvases.
Contributions are welcome! Please read the Contributing Guide to get started.
If you have a bug report or feature request, feel free to open an issue. When doing so, please include your OS, steps to reproduce, and any relevant screenshots.