Cmark is a CommonMark toolkit for the MoonBit programming language,
started as a MoonBit rewrite of the cmarkit
library from the OCaml ecosystem.
So far, it supports the following use cases:
- Parsing CommonMark documents with best-effort source-aware layout preservation:
- Rendering CommonMark documents via the
Renderer
API, along with a ready-to-use HTML renderer.
Supported CommonMark features include:
- Vanilla CommonMark syntax;
- Common syntax extensions, including:
- Strikethroughs
- Task lists
- Footnotes
- Tables
- Inline math
- Math blocks
To begin, you will need to install a recent MoonBit toolchain. To do so, please refer to instructions at MoonBit's official website.
Once you have the toolchain installed, you can build this project by running the following command:
moon build
With the MoonBit toolchain installed, you can run the tests by executing the following command:
moon test
cmark
is built on top several pre-existing projects. Thanks go to:
- Daniel Bünzli for the
cmarkit
project; - John MacFarlane for the CommonMark specification and the
cmark
project; - Martin Mitáš for the
md4c
project.