Zigmark: Markdown parsing and rendering in Zig
A CommonMark-compliant Markdown parser and renderer, written in Zig.
zigmark
A CommonMark-compliant Markdown parser and renderer, written in Zig.
Why we built our own
Markdown is great, but real-world usage has grown well beyond what any single library tends to support. We wanted a stack that combined:
- A complete CommonMark + GFM implementation
- The exact extensions we care about
- A clean way to treat a document and its metadata as one unit, not as two loosely-related blobs.
Most existing tools either missed features we needed or treated frontmatter as something you strip off, process separately, and then glue back on. That made anything beyond “render this file” feel fragile. With zigmark, frontmatter and body stay in one coherent model, so extraction, mutation, and rendering all share the same view of the document.
What it does
zigmark parses Markdown and renders it to multiple formats from a single tool:
- HTML for web output
- Typst for PDF-ready documents driven by frontmatter
- AST and AI-friendly representations for inspection and pipelines
- Normalized Markdown for clean, consistent formatting
- Structured frontmatter in YAML, TOML, JSON, or ZON, with first-class support for reading and editing it in place
We ship it as a CLI, as a Zig library, as a C-callable shared library, and as a WebAssembly module for browser environments.
Licensing
We release zigmark free for noncommercial use under the PolyForm Noncommercial 1.0.0 license. Personal projects, research, education, nonprofits, and government institutions can use it without charge.
zigmark depends on several MIT-licensed components, but the project itself is not MIT-licensed. For commercial users who want to rely on zigmark in products or paid services, we offer commercial licenses so that ongoing maintenance and support can be sustainably funded through SC2.
Commercial use — products, SaaS, or client-billed consulting where zigmark is part of the value you deliver — requires a separate license from us.
To discuss commercial licensing, contact inquiries@sc2.in.
Getting started
For usage examples, build instructions, and API details, see the project on GitHub: