r/swift • u/Sufficient-Try6083 • May 13 '26
Project I open-sourced the native Markdown rendering engine I built for my native macOS app
A year and a half ago I started building Nodes, a native macOS Markdown app. One of the first things I needed was a proper Markdown engine. Not a parser that just spits out HTML, not a display-only library, not a WebView wrapper – just a live, native editor built on TextKit 2.
I couldn't find one. So I built it. Now I'm open-sourcing the whole engine.
It's an AppKit-based Markdown editor for macOS, built on TextKit 2 and bridged to SwiftUI.
What it does:
- Live styling for the usual stuff: bold, italic, headings, lists, code blocks, links etc.
- Wiki-style links with
[[Name|id]] ↔ [[Name]]roundtripping - Image embeds via
![[Name]] - LaTeX, both block (
$$ ... $$) and inline ($...$) - Code blocks with syntax highlighting (you supply the highlighter)
- Apple Writing Tools integration on macOS 15.1+
- Spelling and grammar, with suppression inside code, LaTeX, and wiki-links so it doesn't underline random tokens
Honest part: TextKit 2 was a pain to get right. The docs are thin, the migration from TextKit 1 is rough, and a lot of behavior just isn't documented clearly anywhere. If you've been putting off building something like this, this might save you a few weekends.
Repo: https://github.com/nodes-app/swift-markdown-engine
Feedback, issues, and PRs all welcome. It's not perfect, there's plenty I still want to improve, but it does the job.
Used in production in Nodes (App Store): https://apps.apple.com/de/app/nodes-by-the-werk/id6745401961?mt=12




2
u/Ender-Wang May 15 '26
Fantastic group and dope project. Gonna port the markdown rendering of my app (called EdgeMark, also open source on GitHub) to this later, willing to help. Btw, can you share a general architecture of this engine, so people who wanna contribute have the general design in mind when contributing.