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 = MarkdownParser(
plugins: [
DetailsExtractionPlugin(),
DiagramExtractionPlugin(),
MathExtractionPlugin()
]
)
let document = parser.parse("# Hello MarkdownKit")
let solver = LayoutSolver()
let layout = await solver.solve(node: document, constrainedToWidth: 800)
print(layout.children.count)Sources/MarkdownKit: core parser, AST nodes, plugins, layout engine, UI componentsSources/MarkdownKitDemo: demo appTests/MarkdownKitTests: unit/integration testsdocs/: PRD, feature notes, roadmaptasks/: implementation checklist