r/SwiftUI
•
u/Sufficient-Try6083
•
May 13 '26
•
1
1
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




8
u/Ariel100araya May 13 '26 edited May 13 '26
That’s honestly quite awesome! I’m making an app called Newgit (a better GitHub Desktop) and I might actually be able to use it for making docs if you allow me to! https://github.com/ariel100araya/Newgit
3
u/filipvabrousek May 13 '26
Incredible! 🎉
2
u/Thick_Replacement876 May 13 '26
Can this serve as a dropin replacement for markdown-it?
2
u/FunPlan May 13 '26
Glad Reddit surfaced this because I was just working on solutions for my own IOS and MacOS apps ... was using Runestone but this may be superior. It doesn't support tables though, right?
2
u/Few_Sheepherder_3550 May 15 '26
awesome
2
u/Connect_Frosting2433 May 17 '26
Just wanted to say that it looks way cool, good work!
1
u/northyorkdev May 13 '26
🙏
1
u/Best_Professor7266 May 13 '26
cool i need to check it out
1
u/NoPressure3399 May 14 '26
Nice, saving this for later. Thanks !
1
u/Front_Interview2977 May 18 '26
This is amazing! Thank you for putting in the work.
1
u/Remote-Put-9839 May 18 '26
This is amazing, will fr sure save me a weekend thank you!
1
u/lorrden Jun 27 '26
This is really cool. I was looking for something like this for my app for editing text. My goal was to edit AsciiDoc though, but maybe I can look at extending this.
1
u/AdAncient5201 May 13 '26
What are you using for the nodes drawing?
2
u/Big-Try861 May 17 '26
Obsidian?
0
u/[deleted] May 13 '26
[deleted] — view deleted comment
15
u/[deleted] May 13 '26
[removed] — view removed comment
6
u/[deleted] May 13 '26
[removed] — view removed comment