MarkdownKit is a high-performance native Markdown renderer for Apple platforms, built in Swift with swift-markdown and TextKit-based layout.
- CommonMark + GitHub Flavored Markdown (tables, task lists, strikethrough, links)
- Native table rendering (
NSTextTable) with GitHub-like styling - Math support (
$...$,$$...$$, and fencedmath) via MathJaxSwift - Collapsed sections support (
<details>/<summary>) - Diagram fence detection (
mermaid,geojson,topojson,stl) with pluggable adapter fallback - Async layout pipeline and virtualized iOS/macOS collection views
- Swift 6.2+
- iOS 17.0+
- macOS 26.0+
swift build
swift test
swift run MarkdownKitDemoimport MarkdownKit
let parser = MarkdownKitEngine.makeParser()
let solver = MarkdownKitEngine.makeLayoutSolver()
let document = parser.parse("# Hello MarkdownKit")
let layout = await solver.solve(node: document, constrainedToWidth: 800)
print(layout.children.count)import MarkdownKit
let layout = await MarkdownKitEngine.layout(
markdown: "# Hello\n\nThis is **MarkdownKit**.",
constrainedToWidth: 800
)
print(layout.children.count)bash scripts/verify_all.shOptional heavy benchmark suites:
bash scripts/verify_all.sh --with-benchmarksOne-shot full suite (includes all tests, including benchmarks/snapshots):
bash scripts/verify_all.sh --fullSources/MarkdownKit: core parser, AST nodes, plugins, layout engine, UI componentsSources/MarkdownKitDemo: demo appTests/MarkdownKitTests: unit/integration testsdocs/: PRD, feature notes, roadmapscripts/: local automation and verification entrypointstasks/: implementation checklist