[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107787":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":36,"updatedAt":37,"readmeContent":38,"aiSummary":39,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":40,"discoverSource":41},107787,"splat","sventmueller\u002Fsplat","sventmueller","Native macOS Markdown editor with a live, editable preview: write in the source or straight in the preview. LaTeX, Mermaid, Graphviz and PlantUML offline, export to PDF, HTML and Word. Rust on AppKit, no Electron.","",null,"Rust",91,5,62,0,2,28,46.13,"Apache License 2.0",false,"main",[23,24,25,26,27,28,29,30,31,32,33,34,35],"appkit","gfm","latex","live-preview","macos","macos-app","markdown","markdown-editor","mermaid","objc2","obsidian","rust","wysiwyg","2026-11-22 22:10:10","2026-11-21 11:57:58","\u003Cp>\u003Cimg src=\"assets\u002Freadme-icon.png\" alt=\"Splat app icon\" width=\"168\" height=\"168\">&nbsp;&nbsp;&nbsp;\u003Cimg src=\"assets\u002Freadme-screenshot.png\" alt=\"Splat with dist\u002FDemo.md: the Markdown source on the left, the editable preview on the right\" width=\"274\" height=\"168\">\u003C\u002Fp>\n\n# Splat\n\n**The Markdown editor for macOS that lets you write in the source or straight in the preview.**\n\nSplat puts your Markdown source with syntax colours on the left and a live, fully editable preview on the right. Type\nin either one: whatever you write in the preview becomes a minimal change to the source, so lines you did not touch\nstay byte-for-byte identical and your Git diffs stay clean. Splat reads the Markdown you already use: CommonMark and\nGitHub Flavored Markdown, GitHub alerts, Obsidian wiki links, embeds and callouts, Pandoc and Typora extensions,\nembedded HTML, LaTeX formulas, and Mermaid, Graphviz and PlantUML diagrams, all rendered offline. Export to PDF, HTML\nor Word in one click. It is written in Rust on genuine AppKit controls, speaks 35 languages, and sends nothing over\nthe network unless you ask it to.\n \n\n\n[![Download Splat for macOS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDownload-Splat_for_macOS-0A84FF?style=for-the-badge&logo=apple&logoColor=white)](https:\u002F\u002Fraw.githubusercontent.com\u002Fsventmueller\u002Fsplat\u002Fmain\u002Fdist\u002FSplat-1.0.8.dmg)\n\n**[Download Splat-1.0.8.dmg](https:\u002F\u002Fraw.githubusercontent.com\u002Fsventmueller\u002Fsplat\u002Fmain\u002Fdist\u002FSplat-1.0.8.dmg)**: signed and notarized by Apple, for macOS 14 or later on Apple Silicon and Intel.\n \n \n\n[![Rust 2024 edition](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FRust-2024_edition-000000?logo=rust&logoColor=white)](https:\u002F\u002Fwww.rust-lang.org)\n[![macOS 14 or later](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FmacOS-14%2B-000000?logo=apple&logoColor=white)](https:\u002F\u002Fwww.apple.com\u002Fmacos\u002F)\n![Universal: Apple Silicon and Intel](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FUniversal-Apple_Silicon_%7C_Intel-333333?logo=apple&logoColor=white)\n[![AppKit via objc2](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAppKit-objc2_0.6-147EFB?logo=apple&logoColor=white)](https:\u002F\u002Fgithub.com\u002Fmadsmtm\u002Fobjc2)\n[![WebKit](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FWebKit-offline-0A84FF?logo=safari&logoColor=white)](https:\u002F\u002Fwebkit.org)\n[![Comrak 0.59](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fcomrak-0.59-DEA584?logo=markdown&logoColor=white)](https:\u002F\u002Fgithub.com\u002Fkivikakk\u002Fcomrak)\n[![CommonMark and GFM](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FCommonMark-GFM-24292F?logo=github&logoColor=white)](https:\u002F\u002Fgithub.github.com\u002Fgfm\u002F)\n[![MathJax 4.1.3](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMathJax-4.1.3-1E6E9E?logo=latex&logoColor=white)](https:\u002F\u002Fwww.mathjax.org)\n[![MathLive 0.111.4](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMathLive-0.111.4-5A3FC0)](https:\u002F\u002Fcortexjs.io\u002Fmathlive\u002F)\n[![Mermaid 12.3.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMermaid-12.3.0-FF3670?logo=mermaid&logoColor=white)](https:\u002F\u002Fmermaid.js.org)\n[![Graphviz via Viz.js 3.24](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FGraphviz-Viz.js_3.24-2596BE)](https:\u002F\u002Fgraphviz.org)\n[![PlantUML 1.2026.9](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPlantUML-1.2026.9-A80036)](https:\u002F\u002Fplantuml.com)\n![35 interface languages](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flanguages-35-4C9A2A)\n![Offline by default](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnetwork-offline_by_default-4C9A2A)\n![Signed with Hardened Runtime](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FHardened_Runtime-signed-4C9A2A)\n[![License: MIT OR Apache-2.0](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT_OR_Apache--2.0-4C9A2A)](#license)\n\n[Bahasa Indonesia](assets\u002Freadme\u002Fid\u002FREADME.md) ·\n[Bahasa Melayu](assets\u002Freadme\u002Fms\u002FREADME.md) ·\n[Català](assets\u002Freadme\u002Fca\u002FREADME.md) ·\n[Čeština](assets\u002Freadme\u002Fcs\u002FREADME.md) ·\n[Dansk](assets\u002Freadme\u002Fda\u002FREADME.md) ·\n[Deutsch](assets\u002Freadme\u002Fde\u002FREADME.md) ·\n**English** ·\n[Español](assets\u002Freadme\u002Fes\u002FREADME.md) ·\n[Français](assets\u002Freadme\u002Ffr\u002FREADME.md) ·\n[Hrvatski](assets\u002Freadme\u002Fhr\u002FREADME.md) ·\n[Italiano](assets\u002Freadme\u002Fit\u002FREADME.md) ·\n[Magyar](assets\u002Freadme\u002Fhu\u002FREADME.md) ·\n[Nederlands](assets\u002Freadme\u002Fnl\u002FREADME.md) ·\n[Norsk](assets\u002Freadme\u002Fno\u002FREADME.md) ·\n[Polski](assets\u002Freadme\u002Fpl\u002FREADME.md) ·\n[Português (Brasil)](assets\u002Freadme\u002Fpt_BR\u002FREADME.md) ·\n[Português (Portugal)](assets\u002Freadme\u002Fpt_PT\u002FREADME.md) ·\n[Română](assets\u002Freadme\u002Fro\u002FREADME.md) ·\n[Slovenčina](assets\u002Freadme\u002Fsk\u002FREADME.md) ·\n[Slovenščina](assets\u002Freadme\u002Fsl\u002FREADME.md) ·\n[Suomi](assets\u002Freadme\u002Ffi\u002FREADME.md) ·\n[Svenska](assets\u002Freadme\u002Fsv\u002FREADME.md) ·\n[Tiếng Việt](assets\u002Freadme\u002Fvi\u002FREADME.md) ·\n[Türkçe](assets\u002Freadme\u002Ftr\u002FREADME.md) ·\n[Ελληνικά](assets\u002Freadme\u002Fel\u002FREADME.md) ·\n[Русский](assets\u002Freadme\u002Fru\u002FREADME.md) ·\n[Українська](assets\u002Freadme\u002Fuk\u002FREADME.md) ·\n[עברית](assets\u002Freadme\u002Fhe\u002FREADME.md)‎ ·\n[العربية](assets\u002Freadme\u002Far\u002FREADME.md)‎ ·\n[हिन्दी](assets\u002Freadme\u002Fhi\u002FREADME.md) ·\n[ไทย](assets\u002Freadme\u002Fth\u002FREADME.md) ·\n[한국어](assets\u002Freadme\u002Fko\u002FREADME.md) ·\n[日本語](assets\u002Freadme\u002Fja\u002FREADME.md) ·\n[简体中文](assets\u002Freadme\u002Fzh-Hans\u002FREADME.md) ·\n[繁體中文](assets\u002Freadme\u002Fzh-Hant\u002FREADME.md)\n\n## Contents\n\n- [Features at a glance](#features-at-a-glance)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Getting started](#getting-started)\n- [Writing](#writing)\n  - [In the source](#in-the-source)\n  - [In the preview](#in-the-preview)\n  - [Formatting commands](#formatting-commands)\n  - [Lists and tasks](#lists-and-tasks)\n  - [Tables](#tables)\n- [Supported Markdown](#supported-markdown)\n  - [CommonMark and GitHub Flavored Markdown](#commonmark-and-github-flavored-markdown)\n  - [Callouts](#callouts)\n  - [Extended syntax](#extended-syntax)\n  - [Obsidian](#obsidian)\n  - [Citations and references](#citations-and-references)\n  - [Embedded HTML](#embedded-html)\n  - [Typographic punctuation](#typographic-punctuation)\n  - [Syntax overview](#syntax-overview)\n- [Formulas](#formulas)\n- [Diagrams](#diagrams)\n- [Images](#images)\n- [Links and navigation](#links-and-navigation)\n- [Exporting, printing and sharing](#exporting-printing-and-sharing)\n- [Appearance and accessibility](#appearance-and-accessibility)\n- [Languages](#languages)\n- [Keyboard shortcuts](#keyboard-shortcuts)\n- [Privacy and security](#privacy-and-security)\n- [Large documents](#large-documents)\n- [Known limitations](#known-limitations)\n- [Troubleshooting](#troubleshooting)\n- [For developers](#for-developers)\n  - [Building](#building)\n  - [Distribution](#distribution)\n  - [Testing](#testing)\n  - [Project layout](#project-layout)\n  - [Data flow](#data-flow)\n  - [Rules in the controller](#rules-in-the-controller)\n  - [Adding a command](#adding-a-command)\n  - [Translations](#translations)\n  - [Third-party components](#third-party-components)\n- [License](#license)\n\n## Features at a glance\n\n- **Two ways to write, one text.** Source and preview are both editable. The Markdown file is the only truth: there is\n  one undo history per document, and each preview edit is translated into the smallest change to the source.\n- **The Markdown you already use.** CommonMark, GitHub Flavored Markdown, GitHub alerts, Obsidian, Pandoc and Typora\n  extensions, emoji shortcodes, spoilers, definition lists, heading anchors and HTML as in GitHub READMEs.\n- **Formulas and diagrams built in.** LaTeX formulas via MathJax, with a visual formula editor. Diagrams in Mermaid,\n  Graphviz and PlantUML, rendered on your Mac without Java, a server or a network connection.\n- **A button for everything.** Every Markdown construct has a toolbar button and a menu item, the common ones also a\n  keyboard shortcut. Tables get their own menu for rows, columns and alignment.\n- **Export without losing anything.** PDF, a single self-contained HTML file, or a Word document with real headings,\n  lists, tables, footnotes and images.\n- **Native to the bone.** Real AppKit windows, tabs, menus, popovers, Versions, Auto Save, the share menu, dark mode,\n  spell checking, dictation and VoiceOver. No Electron, no web view for the text itself.\n- **Fast with big files.** Rendering a keystroke in a 10 MB document takes about 10 ms, before the view's own work.\n- **Private and careful.** Images from the web load only after you allow them, links to other apps ask first, and\n  everything that decodes untrusted image data runs in sandboxed helper processes.\n- **In your language.** The interface and the built-in Markdown quick reference come in 35 languages: Arabic, Catalan,\n  Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek,\n  Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese (Brazil),\n  Portuguese (Portugal), Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian and\n  Vietnamese.\n\n## Requirements\n\n- macOS 14 Sonoma or later. Splat is developed and tested on macOS 27, where it picks up the Liquid Glass design\n  automatically.\n- A Mac with Apple Silicon or an Intel processor.\n- About 45 MB of disk space.\n\n## Installation\n\n**From the disk image.** Download [`dist\u002FSplat-1.0.8.dmg`](https:\u002F\u002Fraw.githubusercontent.com\u002Fsventmueller\u002Fsplat\u002Fmain\u002Fdist\u002FSplat-1.0.8.dmg), open it and drag Splat onto the Applications folder. The image is signed with a\nDeveloper ID and notarized by Apple, so it opens without warnings.\n\n**With Homebrew.** The cask lives in a tap of its own:\n\n```sh\nbrew install --cask sventmueller\u002Ftap\u002Fsplat\n```\n\n`brew upgrade --cask splat` installs new versions, and `brew uninstall --zap --cask splat` also removes Splat's settings\nand caches.\n\n**Updates.** Splat from the disk image or Homebrew keeps itself up to date with [Sparkle](https:\u002F\u002Fsparkle-project.org).\nOn the second launch it asks whether it may look for updates on its own, once a day. **Splat › Check for Updates…**\nlooks right away; **Check for Updates Automatically** and **Automatically Download and Install Updates** in the same\nmenu change your choice later. Splat installs an update only if it carries the developer's signature. A build of your\nown has no updater.\n\n**From source.** See [Building](#building) for the prerequisites, then:\n\n```sh\nmake build\nditto target\u002Frelease\u002FSplat.app \u002FApplications\u002FSplat.app\nopen \u002FApplications\u002FSplat.app\n```\n\nTo open Markdown files with Splat by double-click, select any `.md` file in the Finder, choose **File › Get Info**,\npick Splat under **Open with** and click **Change All…**. Splat registers itself for `.md`, `.markdown`, `.mdown` and\n`.mkd` files.\n\n## Getting started\n\n### The window\n\nEach document opens in its own window, or as a tab if you prefer tabs:\n\n- **Left: the source.** Your Markdown in SF Mono with syntax colours.\n- **Right: the preview.** The rendered document, ready to edit.\n- **Outline sidebar (optional).** All headings as a tree; a click on one shows it in both panes. Toggle it with\n  **View › Show Outline** (⌃⌘S).\n- **Toolbar.** Buttons grouped by what they change: characters, paragraphs and inserted elements, then preview on\u002Foff,\n  Share and New Document. Customize it with **View › Customize Toolbar…**.\n\nDrag the divider to give either side more room. **View › Hide Preview** (⌥⌘P) leaves the source alone; Splat\nremembers this per window. Both panes scroll together, and a selection in one pane is highlighted in the other.\n\n### Documents, tabs and versions\n\nSplat is a regular macOS document app:\n\n- **Auto Save and Versions.** Changes are saved in place. **File › Revert To › Browse All Versions…** takes you back\n  in time.\n- **Changes from other programs.** When Git, a script or another editor changes an open document, Splat reloads it\n  and keeps the caret and the scroll position. If you have unsaved changes of your own, Splat keeps them, and macOS\n  asks before saving over the other version.\n- **The usual file commands.** Duplicate (⇧⌘S), Rename…, Move To…, and **File › Open Recent**.\n- **Tabs.** **File › New Tab** or the **+** button in the toolbar opens a new document as a tab; the standard Window\n  menu merges, moves and cycles tabs.\n- **Window placement.** The size and position of your last window are remembered, across restarts as well. If a window\n  already stands there, the new one opens slightly offset.\n- **The Dock icon.** A click on it after you closed the last window opens a new document.\n- **Open Markdown files in Splat.** **Splat › Set as Default App for Markdown** makes a double-click on a `.md` or\n  `.markdown` file open Splat; macOS asks once to confirm. The item shows a checkmark while Splat is the default.\n\nFiles must be UTF-8 text, or UTF-16 with a byte order mark. Splat refuses other encodings rather than guessing and\ncorrupting the text. A byte order mark stays, UTF-16 stays UTF-16, and in a file whose lines all end in CRLF, the lines\nyou add get CRLF as well.\n\n**After a crash**, at most the last few seconds of typing are lost: every five seconds, Splat copies unsaved text to\n`~\u002FLibrary\u002FApplication Support\u002FSplat\u002FUnsaved`, and removes the copies once a document is saved or Splat quits normally.\nThe next start moves what a crash left there to `~\u002FLibrary\u002FApplication Support\u002FSplat\u002FRecovery` and says so once, with a\nbutton that opens the folder. A crash Splat can still react to also writes the text of every open document there.\n\n### Quick reference\n\n**Help › Markdown Quick Reference** opens a cheat sheet in your language as a new, untitled document. It is an\nordinary document, so try everything right there, in the source or in the preview.\n\n## Writing\n\n### In the source\n\nThe source is a plain-text editor tuned for Markdown:\n\n- **Syntax colours** like in VS Code: headings, emphasis, links, code, tables, HTML, front matter, and LaTeX and\n  Mermaid inside formulas and diagrams. There are palettes for light, dark and Increase Contrast.\n- **Fenced code blocks** are highlighted for Bash, C, C++, C#, CSS (also SCSS and Less), Go, HTML, XML, Java,\n  JavaScript, JSON, Kotlin, PHP, Python, Ruby, Rust, SQL, Swift, TypeScript, YAML, TeX and Mermaid, including their\n  usual short names such as `js`, `py` or `sh`.\n- **No surprise substitutions.** Smart quotes, smart dashes and text replacement are off by default, because they\n  break `--`, `---` and `\"`. Turn them on under **Edit › Substitutions**.\n- **The system's writing tools.** Spell and grammar checking, dictation, Find and Replace (⌥⌘F), and Speech.\n- **Drag and drop.** Drop an image file to insert `![name](relative\u002Fpath.png)`, any other file to insert a link to it,\n  and a URL to insert `[url](url)`. Each drop is one undo step.\n- **Paste images.** A picture on the clipboard, such as a screenshot, is saved as a PNG file next to the document\n  (`Image 2026-10-29 13.09.07.png`) and inserted as an image. The document needs to be saved once for this.\n\n### In the preview\n\nThe preview behaves like a word processor, but everything you do in it ends up as Markdown:\n\n- **Typing.** Characters that mean something in Markdown, such as `*` or `#`, are escaped so they appear as typed.\n- **Return** starts a new paragraph or list item. **⌥Return** or **⌃Return** inserts a line break.\n- **Formatting at the cursor.** With the cursor at the end of a word, Bold, Italic and the other character formats\n  apply to what you type next. Choose the format again to stop it. Inside a word, the whole word is formatted.\n- **Empty lines.** Return on an empty line adds another empty line, and Backspace removes it. In the source, each\n  extra empty line is two more blank lines; other Markdown programs show them as normal paragraph spacing.\n- **Undo** works across both panes. Undo items carry names (\"Undo Bold\"), typing is one step per burst, and after Undo\n  and Redo both panes scroll to the change.\n- **Formulas and diagrams** appear as finished graphics. Click one, move the cursor onto it or press Return on it to\n  open its editor (see [Formulas](#formulas) and [Diagrams](#diagrams)).\n- **Embedded HTML, embedded notes and front matter** are shown, but you edit them in the source. A click on them puts\n  the cursor at the matching place there.\n\nAnything Markdown cannot express is blocked in the preview: the Font and Colour panels, the ruler, and pasting or\ndropping rich text and images. Pasted HTML and RTF arrive as plain text.\n\n### Formatting commands\n\nEvery command is available from the toolbar, the menu bar and the context menu of both panes. Menu items show a\ncheckmark for the formatting at the cursor.\n\n| Menu | Commands |\n|---|---|\n| **Format › Font** | Bold, Italic, Underline, Strikethrough, Highlight, Code, Superscript, Subscript |\n| **Format › Heading** | Body Text, Heading 1 to 6 |\n| **Format › List** | Bulleted List, Numbered List, Task List |\n| **Format** | Quote, Code Block (No Language or one of 20 languages; also changes the language of an existing block), Callout (Note, Tip, Important, Warning, Caution; the same type again removes it), Edit Formula or Diagram…, Clear Formatting |\n| **Insert** | Link…, Image…, Table…, Formula, Diagram (Flowchart, Sequence Diagram, Gantt Chart), Table of Contents, Footnote, Horizontal Rule |\n| **Table** | Insert Row Above\u002FBelow, Insert Column Left\u002FRight, Delete Row, Delete Column, Alignment (Left, Center, Right, Default), Align Table Columns |\n| **View** | Hide\u002FShow Preview, Show\u002FHide Outline, Typographic Punctuation, Zoom In\u002FOut, Actual Size, toolbar, tab bar, full screen |\n\nUnderline, highlight, superscript and subscript are written as `\u003Cins>`, `\u003Cmark>`, `\u003Csup>` and `\u003Csub>`, which GitHub\nshows as well. Splat also reads `\u003Cu>`, which GitHub removes, and the shorter `==highlight==`, `^sup^` and `~sub~`.\nGitHub shows `==` and `^` as typed and `~sub~` as strikethrough.\n\n### Lists and tasks\n\n- Return continues a list; Return on an empty item ends it.\n- **Tab** and **⇧Tab** indent and outdent list items in the preview.\n- A click on a task checkbox in the preview toggles `- [ ]` and `- [x]`.\n- **Format › List** turns the selected paragraphs into a list or changes its kind.\n\n### Tables\n\n- **Insert › Table…** asks for the number of rows (including the header) and columns.\n- In the preview, **Tab** moves to the next cell, **⇧Tab** to the previous one and **Return** to the cell below. Tab\n  in the last cell adds a row.\n- The **Table** menu inserts and deletes rows and columns and sets the alignment of a column (⌘{, ⌘|, ⌘}).\n- **Table › Align Table Columns** pads the source so the columns line up.\n\n## Supported Markdown\n\nSplat parses with [comrak](https:\u002F\u002Fgithub.com\u002Fkivikakk\u002Fcomrak), a CommonMark and GFM-compatible parser, and turns on\nmost of its extensions. Everything below renders in the preview and in all exports.\n\n### CommonMark and GitHub Flavored Markdown\n\n- Headings (`#` and underlined), paragraphs, line breaks, emphasis, strong emphasis, inline code, block quotes,\n  horizontal rules.\n- Bulleted, numbered and nested lists; task lists.\n- Links (inline, reference and automatic), images, link reference definitions.\n- Fenced and indented code blocks with syntax colours.\n- Tables with column alignment.\n- Strikethrough with `~~two tildes~~`.\n- Footnotes: `text[^1]` with `[^1]: The note.` anywhere in the document. A click on the marker jumps to the note.\n- YAML front matter between `---` lines at the top. The preview sums it up in one line, such as\n  \"Metadata: title, date, tags\".\n\n### Callouts\n\nGitHub alerts render as coloured boxes with icon and title:\n\n```markdown\n> [!NOTE]\n> Useful information that users should know.\n\n> [!WARNING]\n> Critical content demanding immediate attention.\n```\n\nThe five types are Note, Tip, Important, Warning and Caution. **Format › Callout** turns the paragraph at the cursor\ninto one.\n\nObsidian callouts work too, with any title and a fold state:\n\n```markdown\n> [!tip]- Click ▸ to expand\n> Hidden until opened.\n\n> [!question]+ Open by default\n> A `+` starts expanded, a `-` collapsed.\n```\n\nObsidian's other types are shown in the closest of the five colours: `success`, `check`, `done` and `hint` as Tip;\n`question`, `help` and `faq` as Important; `attention` as Warning; `failure`, `fail`, `missing`, `danger`, `error` and\n`bug` as Caution; everything else as Note.\n\n### Extended syntax\n\n| Feature | Syntax | From |\n|---|---|---|\n| Highlight | `==marked text==` | Obsidian, Typora |\n| Superscript | `x^2^` | Pandoc, Typora |\n| Subscript | `H~2~O` | Pandoc, Typora |\n| Emoji shortcode | `:rocket:` becomes 🚀 | GitHub |\n| Spoiler | `\\|\\|hidden text\\|\\|`, select it to read | Discord |\n| Inline footnote | `text^[the note itself]` | Pandoc, Obsidian |\n| Definition list | `Term`, blank line, `: Explanation` | PHP Markdown Extra, Pandoc |\n| Heading anchor | `## Install {#setup}`, link with `[see](#setup)` | Pandoc, kramdown |\n\nDefinition lists look like this in the source:\n\n```markdown\nTerm\n\n: Explanation of the term.\n```\n\nWithout a custom anchor, every heading gets one derived from its text, as on GitHub: `## Getting Started` is\nreachable as `#getting-started`.\n\n### Obsidian\n\n- **Wiki links.** `[[Note]]` links to `Note.md` in the same folder or a folder below it. `[[Note|Shown text]]` shows\n  your own text, and `[[Note#Heading]]` opens the note. ⌘-click opens it in Splat.\n- **Embeds.** `![[Note]]` shows the other note inside this one; notes embedded in it appear as links.\n  `![[diagram.png]]` shows an image. As in Obsidian, embeds name notes and images in the document's folder or below,\n  never by an absolute path, and only Markdown files show as notes.\n- **Comments.** `%%Only in the source%%` stays visible in the source and is left out of the preview and every export,\n  inline as well as on lines of their own.\n- **Tags.** `#idea` or `#project\u002Fsplat` is highlighted. ⌘-click searches the document for the tag.\n- **Foldable callouts.** See [Callouts](#callouts).\n\n### Citations and references\n\n- **Pandoc citations.** `[@doe2020]` or `[@doe2020; @roe2021]` reads like \"(Doe 2020; Roe 2021)\". The entries come\n  from the BibTeX file that the front matter names as `bibliography: refs.bib`. Without it, Splat uses\n  `references.bib`, `literatur.bib` or `bibliography.bib` next to the document.\n- **GitHub and GitLab references.** If the document lies in a Git repository whose `origin` remote is on github.com\n  or a GitLab host, `@name`, `#12` (issue) and `!7` (merge request, GitLab only) are highlighted. ⌘-click opens them\n  in the browser.\n\n### Embedded HTML\n\nHTML as you find it in GitHub READMEs is rendered, with its own reader rather than a browser engine:\n\n- centered paragraphs and blocks (`\u003Cp align=\"center\">`, `\u003Cdiv align=\"center\">`)\n- images with a size (`\u003Cimg src=\"logo.png\" width=\"120\">`)\n- links, `\u003Ckbd>⌘\u003C\u002Fkbd>`, `\u003Cbr>`, `\u003Cu>`, `\u003Cins>`, `\u003Cmark>`, `\u003Csup>`, `\u003Csub>`\n- lists and tables, including cells that span columns (`colspan`)\n- collapsible sections: `\u003Cdetails>\u003Csummary>More\u003C\u002Fsummary>…\u003C\u002Fdetails>`, opened by a click on ▸\n\nMarkdown between HTML tags is rendered as Markdown. Scripts, styles, frames and forms are left out entirely, and links\nand images keep only `http`, `https`, `mailto` and relative addresses.\n\n### Typographic punctuation\n\n**View › Typographic Punctuation** shows straight quotes as the quotation marks of your interface language, `--` as an\nen dash, `---` as an em dash and `...` as an ellipsis. In German, `\"Ja\"` becomes „Ja“, in French «Oui», in Japanese\n「はい」, also where Chinese and Japanese set quotes without a space; Hebrew abbreviations such as `צה\"ל` get their\ngershayim, צה״ל. The source keeps the plain characters; the preview and all exports show the typographic ones. The\nsetting is off until you turn it on.\n\n### Syntax overview\n\n| Element | Markdown |\n|---|---|\n| **Bold** | `**Bold**` |\n| *Italic* | `*Italic*` |\n| Underline | `\u003Cins>Underline\u003C\u002Fins>` or `\u003Cu>Underline\u003C\u002Fu>` |\n| ~~Strikethrough~~ | `~~Strikethrough~~` |\n| Highlight | `\u003Cmark>Highlight\u003C\u002Fmark>` or `==Highlight==` |\n| `Code` | `` `Code` `` |\n| x² | `x\u003Csup>2\u003C\u002Fsup>` or `x^2^` |\n| H₂O | `H\u003Csub>2\u003C\u002Fsub>O` or `H~2~O` |\n| [Link](https:\u002F\u002Fexample.com) | `[Link](https:\u002F\u002Fexample.com)` |\n| Heading | `# Heading` to `###### Heading` |\n| Quote | `> Quote` |\n| Bulleted list | `- Item` |\n| Numbered list | `1. Item` |\n| Task | `- [ ] Open` and `- [x] Done` |\n| Code block | ```` ```rust ```` … ```` ``` ```` |\n| Table | `\\| A \\| B \\|` with `\\|---\\|---\\|` below the header |\n| Footnote | `Text[^1]` and `[^1]: Note` |\n| Horizontal rule | `---` |\n| Image | `![Alt text](picture.png)` |\n| Formula | `$E = mc^2$`, `$$ … $$` |\n| Diagram | ```` ```mermaid ````, ```` ```dot ````, ```` ```plantuml ```` |\n| Callout | `> [!TIP]` |\n| Wiki link | `[[Note]]`, `[[Note\\|Text]]` |\n| Embed | `![[Note]]`, `![[image.png]]` |\n| Comment | `%%Comment%%` |\n| Tag | `#tag` |\n| Citation | `[@key]` |\n| Spoiler | `\\|\\|Spoiler\\|\\|` |\n| Emoji | `:tada:` |\n\n## Formulas\n\nFormulas are rendered by [MathJax](https:\u002F\u002Fwww.mathjax.org) with its TeX and AMS math, as crisp vector graphics. Text in\n`\\text{…}` can be in any script: what MathJax's fonts lack comes from the fonts of your Mac, with Arabic and Hebrew\nrunning from right to left, and emoji in color.\n\n| Kind | Syntax |\n|---|---|\n| Inline | `$E = mc^2$`, `` $`E = mc^2`$ `` (GitHub, GitLab), `\\(E = mc^2\\)` |\n| Display | `$$` … `$$`, `\\[` … `\\]`, or a code block marked `math` |\n\n**Editing a formula.** Click a formula in the preview, double-click it, press Return on it or move the cursor onto it\nto open its editor in a popover. **Insert › Formula** inserts a new one and opens the editor right away.\n\n- **Visual or LaTeX.** The switch at the top flips between a visual editor ([MathLive](https:\u002F\u002Fcortexjs.io\u002Fmathlive\u002F))\n  and the LaTeX code. Splat remembers your choice.\n- **Building blocks** for fraction, square root, superscript and subscript, sum and integral with limits, limit,\n  brackets that grow with their content, 2×2 matrix, Greek letters, and relations, operators and arrows. They leave\n  placeholders □, and **Tab** jumps to the next one.\n- **Live preview.** Changes appear in the document while you type. Errors from MathJax show in a line below the code.\n- **Commit or discard.** Clicking outside keeps the change as a single undo step; **Esc** or **Cancel** throws it\n  away. Escaping a new, empty formula removes it again.\n- The context menu offers **Edit Formula…** for the formula under the pointer.\n\nVoiceOver reads a formula as its LaTeX code. Splat renders formulas, not complete LaTeX documents: there are no\npackages, no TikZ and no `\\documentclass`.\n\n## Diagrams\n\nDiagrams render inside Splat, offline and in a light and a dark variant.\n\n| Engine | Code block | What it draws |\n|---|---|---|\n| [Mermaid](https:\u002F\u002Fmermaid.js.org) | ```` ```mermaid ```` | flowcharts, sequence, class, state, entity relationship, Gantt, pie, mind maps, timelines and every other Mermaid type |\n| [Graphviz](https:\u002F\u002Fgraphviz.org) | ```` ```dot ```` or ```` ```graphviz ```` | graphs in the DOT language |\n| [PlantUML](https:\u002F\u002Fplantuml.com) | ```` ```plantuml ```` or ```` ```puml ```` | UML diagrams; runs without Java |\n\n```mermaid\nflowchart LR\n    A[Markdown] --> B[Preview]\n    B --> C[PDF]\n```\n\n**Editing a diagram** works like editing a formula: click it to open the code in a popover, with syntax colours and\nerror messages in a line below the code. **Insert › Diagram** starts from a template for a flowchart, a sequence\ndiagram or a Gantt chart. Building blocks help with the three most common Mermaid types:\n\n- **Flowchart:** Node ▾ (rectangle, rounded, circle, diamond, database), Connection, Labeled connection, Group,\n  Direction ▾\n- **Sequence diagram:** Participant, Message, Reply, Note, Loop, Alternative paths\n- **Gantt chart:** Section, Task, Milestone\n\nOther diagram types are edited as code. VoiceOver reads a diagram's title or alternative text.\n\nThe first diagram after launch takes about a second, because the rendering engine starts in the background. A diagram\nthat takes longer than 10 seconds shows an error, and the rendering engine starts afresh for the next one.\nPlantUML's engine (3 MB) loads only with the first PlantUML diagram. A PlantUML `!include` from the web is blocked.\n\n## Images\n\n- **Local images** use paths relative to the document: `![Logo](images\u002Flogo.png)`. Splat shows PNG, JPEG, GIF, WebP,\n  BMP, SVG, HEIC, TIFF, AVIF and PDF.\n- **Images from the web** stay blocked until you allow them: a bar above the preview explains that loading them tells\n  their servers that and when you open the document. **Load Images** allows them for this document; Splat remembers\n  the choice per file.\n- **Size.** `\u003Cimg width=\"200\">` sizes an image; otherwise images fit the width of the preview.\n- **Changes on disk.** An image you replace, or one that appears after the document named it, shows without opening\n  the document again. Images from the web that failed because of the network are tried again while a document shows\n  them.\n- **Memory.** Images show at up to 2560 pixels on their longest side, which also fills an A4 page. They decode smaller\n  once they fill an eighth of the Mac's memory, and while macOS reports memory pressure.\n- **Dark mode.** Images with a white background are slightly dimmed in the dark preview.\n- **Pasting and dropping.** See [In the source](#in-the-source).\n\n## Links and navigation\n\nIn the preview, a click places the cursor so you can edit the link text; **⌘-click** follows the link:\n\n- `http`, `https` and `mailto` open in your browser or mail app.\n- Markdown files open in Splat; other files and folders are revealed in the Finder.\n- `#anchor` jumps to the heading in the document.\n- Addresses that open another app, such as `slack:\u002F\u002F` or `vscode:\u002F\u002F`, ask first and show the full address and the app.\n  **Cancel** is preselected.\n\n**Insert › Table of Contents** inserts a linked list of all headings. With the cursor inside it, the same command\nupdates it. The outline sidebar (⌃⌘S) jumps to any heading in both panes.\n\n## Exporting, printing and sharing\n\n| Format | How | What you get |\n|---|---|---|\n| **PDF** | **File › Export as PDF…** or the Share menu | Paper-sized pages, always in the light appearance, formulas and diagrams as vector graphics. **File › Page Setup…** sets the paper. |\n| **Print** | **File › Print…** (⌘P) | The same layout as the PDF. |\n| **HTML** | **File › Export as HTML…** or the Share menu | One self-contained file: local images embedded, formulas and diagrams as sharp images, heading anchors so the table of contents works. No scripts. |\n| **Word** | **File › Export as Word Document…** or the Share menu | A `.docx` with Word's heading styles, real lists and tables (including merged cells), footnotes as Word footnotes, embedded images, formulas and diagrams. |\n| **Markdown** | The **Share** button in the toolbar | The document as a `.md` file for Mail, Messages, AirDrop and every other share service. |\n\nThe **File › Share** menu offers all of these in one place. Exports use the typographic punctuation setting and the\nimages you allowed from the web; images from the web stay links in HTML.\n\n## Appearance and accessibility\n\n- **Dark mode** follows the system. Formulas and diagrams are rendered for each appearance.\n- **Increase Contrast** in System Settings switches the syntax colours to high-contrast palettes.\n- **Zoom.** ⌘+, ⌘− and ⌘0 scale both panes.\n- **Full screen, tabs and a customizable toolbar**, as in every Mac app.\n- **VoiceOver.** The panes are labelled \"Markdown source\" and \"Preview\", formulas read as their code and diagrams as\n  their title. Every command is reachable from the keyboard.\n\nSplat has no settings window: the few options live where they apply, in **View** and **Edit › Substitutions**.\n\n## Languages\n\nThe interface, the menus and the Markdown quick reference are translated into 35 languages:\n\nArabic, Catalan, Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Danish, Dutch, English, Finnish, French,\nGerman, Greek, Hebrew, Hindi, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Norwegian, Polish, Portuguese\n(Brazil), Portuguese (Portugal), Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Thai, Turkish, Ukrainian and\nVietnamese.\n\nSplat follows the language order in **System Settings › General › Language & Region**; you can also pick a language\nfor Splat alone there under **Applications**. Without a translation for your language, it uses English. Menu terms\nfollow Apple's own translations, so Splat reads like the rest of your Mac.\n\nHebrew and Arabic text reads right to left wherever it appears, whatever the interface language: each paragraph,\nheading and list item takes the direction of its first letter, quotes and callouts draw their bar on the right, and a\ntable whose text starts right to left lists its columns from the right. Code blocks stay left to right. The PDF, HTML\nand Word exports keep these directions. With Hebrew or Arabic as the system language, macOS also mirrors the window,\nso the preview sits on the left.\n\n## Keyboard shortcuts\n\n| Action | Shortcut |\n|---|---|\n| Bold, Italic, Underline | ⌘B, ⌘I, ⌘U |\n| Strikethrough | ⇧⌘X |\n| Link… | ⌘K |\n| Body text, Heading 1 to 6 | ⌥⌘0, ⌥⌘1 to ⌥⌘6 |\n| Align table column left, center, right | ⌘{, ⌘\\|, ⌘} |\n| Hide or show the preview | ⌥⌘P |\n| Show or hide the outline | ⌃⌘S |\n| Zoom in, out, actual size | ⌘+, ⌘−, ⌘0 |\n| New document, open, save, duplicate | ⌘N, ⌘O, ⌘S, ⇧⌘S |\n| Page setup, print | ⇧⌘P, ⌘P |\n| Find, find and replace | ⌘F, ⌥⌘F |\n| Find next, previous; use selection; jump to selection | ⌘G, ⇧⌘G; ⌘E; ⌘J |\n| Show spelling and grammar; check document | ⌘:, ⌘; |\n| Paste and match style | ⌥⇧⌘V |\n| Hide toolbar, show all tabs, full screen | ⌥⌘T, ⇧⌘\\\\, ⌃⌘F |\n| Line break (preview) | ⌥Return or ⌃Return |\n| Next cell \u002F previous cell in a table (preview) | Tab \u002F ⇧Tab |\n| Indent \u002F outdent a list item (preview) | Tab \u002F ⇧Tab |\n| Next placeholder in the formula editor | Tab |\n| Close the formula or diagram editor without changes | Esc |\n| Follow a link, tag or reference (preview) | ⌘-click |\n\nSplat leaves Apple's standard shortcuts where they are.\n\n## Privacy and security\n\nA Markdown file can come from anyone, so Splat treats every document as untrusted.\n\n- **No network by default.** Splat has no telemetry. It looks for updates only once you agree or choose **Check for\n  Updates…**: it then loads a small feed file from GitHub, and the request names nothing but the app and its version.\n  Formulas and diagrams render locally; the web views that do it cannot reach the network.\n- **Images from the web** load only after your permission, only over `https`, never from hosts in your local network,\n  at most 10 MB each, and in a private session without cookies.\n- **Isolated decoding.** Images and the graphics of formulas and diagrams are decoded in helper processes that close\n  every file they inherited and lock themselves into a sandbox before reading the first byte: no file access, no\n  network. They hand back only pixels, whose size is checked, and are stopped after 10 seconds. Apple's own image\n  decoders only see HEIC, TIFF, AVIF and PDF, and only when the data really is that format; they run in a helper of\n  their own, which may in addition read the system's font folders and use the system's video decoder. SVGs, formulas\n  and diagrams pass that helper as well, so they are pictures with a fixed resolution in Splat: four pixels per point,\n  up to 2560 on the longer side.\n- **Local files** reach a document only by the path it names. Embeds show Markdown notes from the document's folder\n  and below, and a missing picture is looked for only there. An image path elsewhere, absolute or starting with `~`, still loads in the preview; HTML and Word exports, printing and PDFs take along only what lies in the document's folder or its Git repository, unless that repository also holds your home folder, so a document from someone else cannot pull your files into an export you pass on.\n- **Copies of unsaved text** stay on this Mac, in your Library folder, for the recovery after a crash. They leave\n  with the save or the normal end of Splat; the copies a crash left behind stay in the recovery folder until you delete\n  them.\n- **Links** never start a program by a click. Web and mail links open as usual; links to other apps ask first.\n- **HTML in documents** is read by Splat's own parser. Scripts, styles, frames and forms never run.\n- **Exports** carry no scripts. HTML pages keep only a fixed list of harmless tags and attributes, as GitHub does, plus\n  a content security policy. Word files link only `http`, `https` and `mailto` addresses.\n- **Code signing** with the Hardened Runtime. Splat runs without the App Sandbox so that it can show images next to\n  your documents without asking for every folder; the isolation of all decoding offsets this.\n\n## Large documents\n\nSplat stays responsive with documents of several megabytes:\n\n- The source uses TextKit 2, which lays out only the visible part.\n- While you type in the preview, and in the source of documents up to 2 MB, only the affected paragraphs are parsed,\n  coloured and laid out again. In a 10 MB document, parsing and colouring take about 3 ms, rendering about 10 ms, and a\n  whole keystroke in its preview about 30 ms with the view's own work.\n- Large previews render the visible part first and the rest while the app is idle. Blocks scrolled into view are\n  rendered before they are drawn.\n- In the source of larger documents, parsing for the preview runs in the background while you type.\n- A document stays plain text once it would take about 4 GB of memory, which is roughly 50 to 120 MB of ordinary\n  Markdown but only 10 to 20 MB of nothing but tables or headings: the source has no colours and the preview says why\n  it stays empty. Exports still work.\n- From about 200 KB, a document opens its window before it is parsed; at 5 MB, the colours and the preview follow\n  about a quarter of a second later.\n- All pictures together, including formulas and diagrams, take at most a quarter of the Mac's memory and half of that\n  while memory is short. Beyond that, further pictures show as placeholders until there is room again.\n\nSome changes are processed in full, at around 300 ms per keystroke at 10 MB: those to a footnote's definition or\nreferences, next to an inline footnote, at the very end of a document next to a footnote, to the front matter or to\nlink reference definitions, and every change in a document with `%%` comment blocks or with a footnote defined twice\nor inside a quote or list. Memory grows with the file, to roughly 115–160 MB for 1 MB of Markdown and 340–510 MB for 10 MB.\n\n## Known limitations\n\n- **Single tildes mean subscript.** `~text~` is subscript as in Pandoc; strikethrough needs `~~two~~`. GitHub also\n  strikes through with one tilde.\n- **Read-only in the preview:** embedded HTML, embedded notes and front matter are edited in the source.\n- **Very deep nesting:** HTML nested deeper than 64 levels, and inline HTML deeper than 16, gives way to its content.\n- **Merged table cells** exist only in HTML tables, and only across columns (`colspan`, no `rowspan`). MultiMarkdown's\n  table syntax for merged cells is not supported.\n- **Bibliographies** are read from BibTeX only, not from CSL JSON or YAML.\n- **References** need a repository on github.com or a GitLab host; `!7` exists only on GitLab.\n- **Typographic punctuation:** a German closing single quote cannot be told apart from an apostrophe and is set as ’.\n- **Formulas, not documents:** no LaTeX packages, TikZ or full documents.\n- **The visual formula editor** writes LaTeX in MathLive's notation: spaces disappear (`E = mc^2` becomes `E=mc^2`),\n  the rendering stays the same.\n- **By design:** no line numbers, no settings window, no Help Book, not in the App Store.\n- **Tested less on Intel.** The window self-tests run on Apple Silicon only; on Intel, CI runs `cargo test`.\n\n## Troubleshooting\n\n**The recent documents list is empty after I rebuilt Splat.** macOS ties recent documents and folder permissions to\nthe app's code signature. Local builds are signed with the certificate \"Splat Local Signing\" in your login keychain,\nso rebuilds keep both. If the certificate was deleted, the next build creates a new one and the lists start over once.\n\n**The app from the disk image shows other recent documents than my own build.** The two carry different signatures,\nso macOS keeps a separate list and separate folder permissions for each.\n\n**HTML or other syntax shows as plain code.** An outdated copy of Splat may have opened the document. Quit it,\nchoose **File › Get Info** on the document in the Finder and check that **Open with** names the Splat in your\nApplications folder.\n\n**There is no Check for Updates… in the Splat menu.** Only the version from the disk image or Homebrew updates\nitself; a build of your own has no updater.\n\n**Images from the web do not appear.** Click **Load Images** in the bar above the preview. Only `https` images from\npublic hosts load.\n\n**Pasting a screenshot asks me to save first.** Pasted images are stored as files next to the document, which needs a\nplace on disk. Save it, then paste again.\n\n**\"The file is not UTF-8 text.\"** The file is in another encoding and has no byte order mark that would name it.\nConvert it first, for example with `iconv -f ISO-8859-1 -t UTF-8 old.md > new.md`.\n\n**A formula or diagram shows an error.** Click it: the editor shows the message of MathJax, Mermaid, Graphviz or\nPlantUML below the code.\n\n## For developers\n\nSplat is a Rust application that talks to AppKit and WebKit directly through\n[objc2](https:\u002F\u002Fgithub.com\u002Fmadsmtm\u002Fobjc2). There is no Swift, no Objective-C, no Xcode project and no Interface\nBuilder file.\n\n### Building\n\nPrerequisites:\n\n- macOS with the Command Line Tools (`xcode-select --install`). Xcode is not needed; Splat builds without `actool`,\n  `ibtool` and `metal`.\n- Rust 1.99 (`brew install rust`). [rust-toolchain.toml](rust-toolchain.toml) names the exact version that CI uses;\n  rustup installs it on its own, Homebrew's Rust ignores the file. Raising it there is how new compiler and clippy\n  warnings reach the project.\n- rustup, for `make lint`, `make check` and `make universal`: `cargo xtask check-library` builds the library for Linux\n  to show that it needs no macOS, and Homebrew's Rust has no other targets.\n\nThe [Makefile](Makefile) holds short entry points; `make help` lists them all:\n\n```sh\nmake build                  # target\u002Frelease\u002FSplat.app, same as cargo xtask bundle --release\nmake universal              # target\u002Fsplat-universal for Apple Silicon and Intel, as the disk image carries it\nmake check                  # formatting, clippy without warnings, all tests, vendored libraries; what CI runs\nmake test                   # make check, then the self-test without a window\nmake test-gui               # self-tests with a window; they occupy the Mac for about four minutes\nmake test-long              # longer randomised search and the 10 MB partial-update check\nmake fuzz                   # random input for the partial parse and every output\nmake coverage               # line coverage of all tests and self-tests, with a floor per module\nmake coverage-library       # the same floors for the modules without a window, as in CI\nmake bench FILE=\u003Cfile.md>   # timings for opening, typing and scrolling a large file\nmake release                # make test first, then the notarized disk image\n```\n\nThe build logic itself lives in the Rust crate [xtask](xtask\u002Fsrc\u002Fmain.rs):\n\n```sh\ncargo xtask bundle --release   # target\u002Frelease\u002FSplat.app, Hardened Runtime, signed with \"Splat Local Signing\"\ncargo xtask bundle             # target\u002Fdebug\u002FSplat Debug.app, a separate app that never opens Markdown files\ncargo xtask dmg                # dist\u002FSplat-\u003Cversion>.dmg for distribution, Developer ID, notarized\ncargo xtask icon               # rebuild assets\u002FAppIcon.icns and the README icon from assets\u002Ficon-1024.png\ncargo xtask vendor check       # verify the bundled JavaScript against vendor.lock\ncargo xtask vendor fetch       # download it again after changing a version in vendor.lock\n```\n\n`bundle` writes the `Info.plist`, copies the resources and localizations, and signs the app with the certificate\n\"Splat Local Signing\". The first build creates that certificate in your login keychain, valid for 20 years. As long\nas it stays, Splat keeps its recent documents and folder permissions across rebuilds; with an ad hoc signature, every\nbuild would be a new app to macOS. Debug and self-test builds carry bundle IDs of their own (`local.splat.debug`,\n`local.splat.selftest`) and do not register for Markdown files, so the Finder never opens a document in an outdated\nbuild and they leave the settings of the normal app alone.\n\nThe version lives in [VERSION](VERSION) as `major.minor.build` and is the one the next build gets. Every release\nbuild that succeeds (`make build`, `cargo xtask bundle --release`, `make release`) raises the build number by one;\ndebug and self-test builds leave it alone. Major and minor are raised by hand: set VERSION to, say, `1.1.0`, and the\nnext build gets exactly that.\n\n### Distribution\n\n`cargo xtask dmg` (or `make release`, which runs `make test` first) builds a release, signs it with your Developer ID,\nnotarizes the app with Apple and staples the ticket, packs it into a compressed, read-only disk image with a link to\nApplications, notarizes and staples the image as well and checks the result with Gatekeeper. The app carries its own\nticket so that a copy installed without the Finder, as Homebrew does, opens offline on first launch too; the two\nrounds with the notary service take a few minutes each. Only an image that passed every step becomes\n`dist\u002FSplat-\u003Cversion>.dmg`, the copy that is committed: the download links in this README and its translations follow it, and the build\nnumber goes up. The previous image stays for one more release, since GitHub's raw server may hand out the old update\nfeed for a few minutes after a push; older ones are moved to the trash. A failed run leaves `dist\u002F`, the READMEs and\nVERSION as they were.\nEach release adds the full image, about 16 MB, to the repository history. It runs only when called, never as part of a normal build, and needs:\n\n- a \"Developer ID Application\" certificate in the keychain\n- a saved login for Apple's notary service with an app-specific password, created once with\n  `xcrun notarytool store-credentials notary --apple-id \u003CApple ID> --team-id \u003Cteam ID>`\n- the private key that signs updates, in the login keychain. Sparkle's `generate_keys` created it; its public half is\n  `UPDATE_KEY` in [xtask\u002Fsrc\u002Fmain.rs](xtask\u002Fsrc\u002Fmain.rs) and inside every installed copy, which accepts only updates\n  signed with it. Keep a backup in a password manager: `target\u002Fsparkle-2.10.1\u002Fbin\u002Fgenerate_keys -x \u003Cfile>` exports\n  it, `-f \u003Cfile>` imports it on another Mac. Without it, installed copies can never be updated again.\n- rustup (`brew install rustup`, which leaves Homebrew's Rust in place)\n\nIf any of them is missing, `dmg` stops before building. On the first run, macOS asks whether Terminal may control the\nFinder; without that permission, the disk image shows neither its background nor the icon arrangement.\n\nOnly the disk image carries the updater, [Sparkle](https:\u002F\u002Fsparkle-project.org), which the build downloads once into\n`target\u002F` from its GitHub release and checks against the checksum in xtask. The hardened runtime loads the framework\nonly when it carries the app's Team ID, which the Developer ID signature has and the local certificate lacks; and an\nupdate must not replace a build of your own. The self-test build carries Sparkle as well, to check the update menu\nagainst it: with a feed that does not exist, without Sparkle's question on the second launch, and with an entitlement\nthat lets the locally signed app load the framework. `dmg` signs the new image with the update key and writes\n`dist\u002Fappcast.xml`, the feed installed copies read from GitHub. Commit and push the image, the feed and the READMEs\ntogether: from then on, installed copies offer the update.\n\nThe disk image is a universal binary for Apple Silicon and Intel; other builds are for the host processor alone.\nHomebrew's Rust ships the standard library for the host processor only, so `dmg` builds through rustup, which installs\nthe toolchain and targets of [rust-toolchain.toml](rust-toolchain.toml) on first use, and stops if the program or\nSparkle lacks the code for either processor. `make universal` builds only the program.\nThe app in it carries a different signature from a local build, so macOS keeps separate recent documents and folder\npermissions for the two.\n\n### Testing\n\n| Command | Checks |\n|---|---|\n| `cargo test --release` | unit, randomised and translation tests |\n| `SPLAT_FUZZ_ROUNDS=20000 cargo test --release` | a longer randomised search; `SPLAT_FUZZ_SEED` varies the inputs |\n| `SPLAT_I18N_ONLY=fr cargo test --release i18n` | one language, while others are incomplete |\n| `cargo clippy --release --all-targets [--features selftest]` | lints, including the justification of every `unsafe` block, the length of functions and, in the library, number conversions |\n| `cargo xtask check-library` | the library builds for Linux, so nothing in it needs macOS |\n| `cargo xtask vendor check` | the JavaScript libraries match `vendor.lock` byte for byte |\n| `cargo xtask selftest probe` | without a window, each with its expected result: formulas, diagrams, web images against a server inside the process, blocked addresses, the text every command writes, each image format through both exports, a page that stops answering, and the defences of the web views against a page without them. Takes about half a minute. What needs the app in front is skipped on a locked screen |\n| `cargo xtask selftest gui [--stop-after \"\u003Ccheck>\"] [--scenarios] [--only \"\u003Cgroup>\"] [--in-back]` | the running app, click by click. Opens a window and types into it; the Mac is busy for about four minutes. `--scenarios` runs only the second part, in about a minute and a half. `--only` runs one group of that part, in its own document, also on a locked screen. `--in-back` leaves out what needs the app in front; without it such a check fails |\n| `cargo xtask selftest resize` | widens the window after moving the divider: the source re-wraps while the window is resized. Takes about ten seconds |\n| `cargo xtask selftest typing [--by-hand]` | types through saves, with keys through the app's event queue or, with `--by-hand`, from a person: what is typed stays and shows as unsaved. Takes about a minute |\n| `cargo xtask selftest bench \u003Cfile.md> [--keystroke-ms \u003Cn>]` | timings for opening, typing and scrolling a large file; `--keystroke-ms` fails when the fastest keystroke takes longer |\n| `cargo test --release -- --ignored partial_updates` | a keystroke in 10 MB: partial against full update, the same result in a quarter of the time at most |\n| `cargo test --release --test hostile` | documents built to overflow the stack or take quadratic time, each at two sizes whose times must grow as the text does, through parsing, layout, both exports, keystrokes and commands |\n| `make mutants` | faults built into `crates\u002Fsplat-markdown`, `crates\u002Fsplat-preview` and `crates\u002Fsplat-file-state` one by one, through [cargo-mutants](https:\u002F\u002Fmutants.rs) (`cargo install cargo-mutants`); says which ones no test notices. Takes hours; `FILE=crates\u002Fsplat-preview\u002Fsrc\u002Fbridge\u002Fmod.rs` narrows it |\n| `make fuzz` | random input through [cargo-fuzz](https:\u002F\u002Fgithub.com\u002Frust-fuzz\u002Fcargo-fuzz), which needs rustup's nightly: keystrokes that must read as a full parse, every output, edits in the preview, every command and a file that saves as it opened. `SECONDS=600` searches longer |\n| `cargo test --release --test fuzz_seeds` | the seeds in `fuzz\u002Fseeds\u002F` through the checks of those fuzz targets, without a fuzzer; part of every `cargo test` |\n| `cargo test --profile checked --workspace` | the tests with what a debug build checks on top: after every partial parse the blocks fit their text, and what it carries on is what the text says. Part of `make test-long` |\n| `cargo test --release --test entry_points --test structure` | from the sources: everything the system calls is guarded against panics, and modules depend downwards only |\n| `cargo test --release --test decoder` | the decoder process decodes images and reaches neither files nor the network |\n| `make coverage` | line coverage of `cargo test` and all self-tests, through [cargo-llvm-cov](https:\u002F\u002Fgithub.com\u002Ftaiki-e\u002Fcargo-llvm-cov) (`brew install cargo-llvm-cov llvm`); fails below the floors. Occupies the Mac for about five minutes |\n| `make coverage-library` | the crates `splat-markdown`, `splat-preview`, `splat-file-state` and `splat-i18n` against their higher floors, measured by `cargo test` alone |\n\nUnit tests sit next to the code they test. `crates\u002Fsplat-testkit\u002Ftests\u002F` holds what reaches the model and the preview from\noutside: the randomised tests in `robustness.rs`, which share the generator of `splat-testkit` with those of `sync.rs`, the\ndocuments built to hurt in `hostile.rs`, and the seeds of the fuzz targets in `fuzz_seeds.rs`. `tests\u002F` holds what looks at\nall of the program: its sources, its translations and the decoder test, which starts the built program. Decisions in `src\u002Feditor\u002F` that need no window live in free functions with tests of their\nown: everything the controller knows and how that changes in `state.rs`, the rules of rendering in `render_queue.rs`, the text copy in `sync.rs`, paragraph styles, fonts and colours as values in `render.rs`, what toolbar identifiers stand for in `toolbar.rs`, what a link click means in `navigation.rs`.\n\nA step of the window self-test waits for a named condition, not for a time; only what gives no signal, like the absence of something, keeps a pause with its reason. Waiting in vain is a failed check that names what never came, a step that panics is a failed check as well, and the run goes on either way. A check that cannot say anything in this run reports `SELFTEST SKIP`: xtask lists it, and it neither passes nor fails. xtask holds each mode, and `--scenarios` of its own, to about nine tenths of its checks. The window\nself-test runs a second part after its main click-through, in `src\u002Feditor\u002Fselftest\u002Fscenarios.rs`: every formatting and\ntable command, the dialogs, link clicks, pasting, dropping, exports, a file another program changed, a large change, images\nchanging on disk, memory pressure, a huge document and the recovery after a crash. Each group of it opens a document of its\nown, so that a failure in one does not reach the next, and each can run alone with `--only`. The probe also breaks saving on\npurpose: a folder that takes nothing, a read-only file, a folder that has gone, a full disk, and a panic in every callback of\na save, none of which may cost text.\n\nCoverage has two floors: every module at least 84 % of its lines, all modules together at least 96 %. `make coverage`\nmeasures `cargo test` together with the self-tests and fails below either; `make coverage-library` holds what needs no window to 90 % and 97 %. The floors and the few exceptions, such\nas the panic hook in `main.rs` that runs only in a crash, are in [xtask](xtask\u002Fsrc\u002Fcoverage.rs) next to their reasons.\nMeasured builds go to `target\u002Fcoverage\u002F`, so measuring code never reaches `target\u002Frelease\u002F` or a disk image. The\ndecoder helper opens its measurement file before it locks itself in, so it is measured as well.\n\nCI ([.github\u002Fworkflows\u002Fci.yml](.github\u002Fworkflows\u002Fci.yml)) runs `make check`, `make coverage-library` and the universal\nbuild on Apple Silicon and `cargo test` on Intel for every push to `main` and every pull request. Every night,\n[.github\u002Fworkflows\u002Fnightly.yml](.github\u002Fworkflows\u002Fnightly.yml) runs `make test-long` with new random inputs. The self-tests and the disk image stay on the developer's Mac: they need a screen and the\nsigning certificates in the keychain.\n\nSelf-test output goes to `target\u002Fselftest\u002F`. The self-test builds a separate app (`target\u002Frelease\u002FSplat Selftest.app`,\nbundle ID `local.splat.selftest`) and leaves the settings, recent documents and file associations of the normal app\nuntouched.\n\n### Project layout\n\nEverything that needs no window is a crate of its own under `crates\u002F`, which builds without macOS, so the compiler holds the\nway they depend on each other. The app in `src\u002F` (package `splat-app`, program `splat`) builds on them.\n\n- `crates\u002Fsplat-markdown\u002F`: the tree every consumer reads, `Doc` in `doc\u002F`, which owns its text, and the only binding to the\n  parser in `reader\u002F`: comrak is named nowhere else, and `reader\u002Fassumptions.rs` holds what the code assumes about it.\n  Syntax colours, and all commands as pure text edits (`Edit`) in `commands\u002F`. Also re-parsing after an edit\n  (`incremental.rs`), the reader for embedded HTML (`markup.rs`), typography, tags, references and citations in running\n  text (`typography.rs`), how text looks and which Markdown and HTML make it so (`style.rs`), what an address may be\n  (`url.rs`), and the HTML and Word export (`html.rs`, `docx.rs` with `docx\u002Fhtml.rs` and `docx\u002Fxml.rs`). A position has\n  its type: `Byte` in the source text, `U16` in the source view, `Shown` in the preview view (`text.rs`).\n- `crates\u002Fsplat-preview\u002F`: the preview layout in `layout\u002F`, with embedded HTML in `layout\u002Fhtml.rs`, and the mapping between\n  preview and source (`Bridge`, `Index`). A `Bridge` refuses a layout of another version of the `Doc`.\n- `crates\u002Fsplat-file-state\u002F`: which text a file holds, in which format, and what a look at it means.\n- `crates\u002Fsplat-i18n\u002F` with `resources\u002F*.lproj`: 35 languages; the keys are the German texts, and the app installs the table\n  of the interface language at its start.\n- `crates\u002Fsplat-testkit\u002F`: the generator of the randomised tests and the checks of the fuzz targets.\n- `src\u002Feditor\u002F`: the window. One `EditorController` object serves AppKit as delegate of both views and forwards to\n  components, small structs over the controller and the state they own, whose fields the other modules cannot reach:\n\n| Module | Responsibility |\n|---|---|\n| `controller.rs` | class, delegate methods that forward, `invalidate`, and what the rest of the program tells an editor; only it reaches the components |\n| `panes.rs` | `Panes`: the text views, the outline, showing and hiding panes, and what gives access to the views |\n| `controller\u002Flayers.rs` | who may reach whom: a component gets a handle of the controller that offers what lies below it, and the compiler holds to that |\n| `state.rs` | what the controller knows about the document and every way that changes; its fields are private, and it touches no view |\n| `model.rs` | lends the state and the text copy to closures that cannot reach a view |\n| `actions.rs` | command registry: selector, title, shortcut, symbol, when the command applies |\n| `editing.rs` | `Editing`: running and validating commands, typing in the preview |\n| `update.rs` | `Updater`: parsing, colouring, updating the preview; after an edit only the affected paragraphs |\n| `sync.rs` | text copy and block bookkeeping, without AppKit and with randomised tests |\n| `progressive.rs` | `Progressive`: rendering large previews step by step |\n| `selection.rs`, `scroll.rs` | `Selection`, `ScrollSync`: selection and scroll position of both panes in step |\n| `atom.rs`, `atom\u002Fedit.rs` | `AtomEditor`: the formula and diagram editor |\n| `navigation.rs`, `links.rs` | `Links`: links, wiki links, tags, task checkboxes, folding, footnotes |\n| `env.rs` | what the preview reads from outside the text: typographic punctuation, the repository for `@name` and `#12`, the BibTeX file, embedded notes |\n| `render.rs`, `images.rs`, `picture.rs`, `remote.rs`, `safe_image.rs` | preview text, local and remote images; `Pictures` in `images.rs` |\n| `attributes.rs` | text attributes; each key only gets a value of the type it expects |\n| `shadow.rs` | copies of unsaved text for the recovery after a crash |\n| `decoder.rs` | sandboxed helper processes that decode images and graphics |\n| `export.rs`, `outline.rs` | `Sharing`: HTML and Word export, the share file, printing; the outline sidebar |\n| `js.rs`, `mathfield.rs`, `render_queue.rs` | WebKit for MathJax, Mermaid, Graphviz, PlantUML and the visual formula editor; the rules of what renders when, apart from WebKit |\n| `webkit.rs` | calls into WebKit; only the navigation delegate's lifetime stays with `js.rs` and `mathfield.rs` |\n| `controller\u002Fwindow.rs`, `toolbar.rs`, `views.rs`, `dialogs.rs`, `style.rs` | building the window, toolbar, text views, dialogs, colours |\n\n- `src\u002Fmenu.rs`, `src\u002Fapp.rs`, `src\u002Fdocument.rs`: menu bar, app delegate, document (`MDDocument`, an `NSDocument`\n  subclass).\n- `src\u002Futil\u002F`: worker threads (`lanes.rs`), volumes that may stop answering (`volumes.rs`), AppKit helpers, files and\n  processes. `src\u002Fdiag.rs`: what goes wrong out of the user's sight goes to the system log, without any text of a document.\n- `src\u002Flarge_alloc.rs`: large allocations come straight from the kernel and go back to it when freed, so memory\n  returns after big edits.\n- `resources\u002Fjs\u002F`: web pages and libraries; versions and checksums in [vendor.lock](vendor.lock).\n- `xtask\u002F`: bundling, signing, the disk image, the icon, vendoring, the self-test runner and the coverage floors.\n\n### Data flow\n\nThe source text in the left text view is the single source of truth.\n\n1. Every character change there updates the text copy (`Snapshot`) in place, without reading the text again.\n2. An update parses the copy, recolours the source only where colours changed, lays out the preview and replaces only\n   the blocks whose content changed.\n3. After an edit, only the affected paragraphs are parsed, coloured and laid out again, as long as their neighbours\n   stay the same; [docs\u002Fpartial-parse.md](docs\u002Fpartial-parse.md) says why that gives what a full parse gives, and what to\n   look at when comrak changes. Documents with `%%` comment blocks, changes to the\n   front matter and, in a document with link reference definitions, changes to a part holding a bracket are processed\n   in full. comrak recognizes a footnote\n   reference only with its definition in the same parse and moves definitions behind the text, so the part is parsed\n   with a stand-in definition per label and takes its numbers from the old tree; a change to the references or\n   definitions in the part, or next to an inline footnote, is processed in full.\n4. HTML blocks that open `\u003Cdetails>` or `\u003Cdiv align>` and close it later affect the Markdown blocks in between; a\n   reused block must have the same surroundings.\n5. While you type in the source of a document up to 2 MB, the partial update runs immediately; when it does not apply,\n   or in a larger document, parsing and layout run in the background. While you type in the preview, they run\n   immediately, because the preview's cursor depends on the result.\n6. Input in the preview is translated by `Bridge` into an edit of the source and takes the same path from there.\n   Markdown has too many ways of turning text into syntax for rules alone, so `preview\u002Fverify.rs` parses the changed part\n   again and compares what it shows with what was typed; an edit that does not hold is escaped further or refused.\n7. comrak's inline positions go wrong in a few places, for example behind a link reference definition. `reader\u002Fpositions.rs`\n   checks them against the source when reading a block and reads them again from the source where they do not fit.\n\n### Rules in the controller\n\n1. The controller's own changes to the views run inside `Panes::silently`; the delegate callbacks ignore them. Everywhere\n   else the views can only be read, so the compiler checks this. What the callbacks are meant to hear, or what hands a\n   view to AppKit, says so by going through `Panes::for_appkit`.\n2. The state is borrowed only to read and compute, never across a call that changes, lays out or scrolls a view: `Model`\n   lends it to `Send` closures, and no view is `Send`, so the compiler checks this. It changes through its own methods\n   only, whose tests need no window.\n3. Messages from outside (an image loaded, a formula rendered) arrive delayed through `renders_arrived` and `image_arrived`, never in the\n   middle of an update.\n4. Redrawing without a text change goes through `invalidate(reason)` only.\n5. The text copy is not held across a change of the source, or that change copies the whole text: `with_text` lends it\n   for the length of a `Send` closure only.\n6. A new command needs an entry in `actions.rs`, a method in `controller.rs` and a branch in `Editing::perform`.\n7. Every `unsafe` block carries its justification as a `\u002F\u002F SAFETY:` comment. Bytes reach the system's image decoders in\n   the helper process only, through `decoder::decode_native`; a test scans the sources for other calls.\n8. Nothing on the main thread waits for the user's folders, since a network volume can stop answering: files are\n   looked at on the thread `DISK`, and the preview reads the answers through `Env::known`. Only an action the user\n   waits for, like an export or saving, may touch the disk directly.\n9. What has to end also ends after a panic, as the main thread survives one: a raised flag goes through `with_raised`, an\n   editing of the text storage through `editing`, and what undo is not to know of through `without_undo`. A test finds these\n   written by hand.\n10. An address in a document has one reading, in `splat_markdown::url`; a test finds schemes compared by hand.\n\n### Adding a command\n\nThe menu bar, the toolbar and the context menu all build their items from the registry in\n[src\u002Feditor\u002Factions.rs](src\u002Feditor\u002Factions.rs), and menu validation reads there when a command applies and whether it\nshows a checkmark. A new command needs:\n\n1. a variant of `Action` with its `Spec`: selector, title, toolbar label, tooltip (starting with a verb, at m","Splat 是一款专为 macOS 设计的原生 Markdown 编辑器，支持源码与所见即所得预览双栏同步编辑。核心功能包括实时可编辑预览（修改预览自动反向更新源码且保持 Git 友好）、离线渲染 LaTeX 数学公式、Mermaid\u002FGraphviz\u002FPlantUML 图表，以及 CommonMark\u002FGFM\u002FObsidian 扩展语法支持；导出 PDF、HTML 和 Word 文档。基于 Rust + AppKit 构建，无 Electron 依赖，完全离线运行，适合技术文档撰写、学术笔记、开发者知识管理等注重格式兼容性、版本控制友好性与隐私安全的 macOS 用户场景。","2026-11-24 04:32:57","CREATED_QUERY"]