cmark: Haskell bindings to libcmark, CommonMark parser and renderer
cmark provides the following advantages over existing Markdown libraries for Haskell:
Robustness: cmark can handle whatever is thrown at it, without the exponential blowups in parsing time one can sometimes get with other libraries.
Accuracy: cmark passes the CommonMark spec's suite of over 500 conformance tests.
Standardization: Since there is a spec and a comprehensive suite of tests, we can have a high degree of confidence that any two CommonMark implementations will behave the same. Thus, for example, one could use this library for server-side rendering and commonmark.js for client-side previewing.
Ease of installation: cmark has minimal dependencies.
cmark does not provide Haskell versions of the whole
libcmark API, which is built around
cmark_node objects. Instead, it provides two functions:
markdownToHtmluses libcmark's parser and renderer for a maximally efficient conversion of CommonMark to HTML (as a Text). ("Smart punctuation" and a few other options can be enabled.)
parseDocumentuses libcmark's parser to produce a
Nodetree that can be processed further using Haskell. One can transform the tree using generics, convert it to another kind of structure (such as a Pandoc object that can be rendered using pandoc's renderers) or render it using a custom rendering function.
A note on security: This library does not attempt to sanitize HTML output. We recommend using xss-sanitize to filter the output.
A note on stability: There is a good chance the API will change significantly after this early release.
[Skip to Readme]
|Versions [faq]||0.1.0.0, 0.1.0.1, 0.2, 0.2.0.1, 0.2.0.2, 0.3, 0.3.0.1, 0.3.1, 0.3.2, 0.3.3, 0.3.3.1, 0.3.4, 0.3.5, 0.4.0.1, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.5.2.1, 0.5.3, 0.5.3.1, 0.5.4, 0.5.5, 0.5.5.1, 0.5.6, 0.5.6.1, 0.5.6.3, 0.6 (info)|
|Dependencies||base (>=4.5 && <4.8), ghc-prim (>=0.2), mtl, syb, text (>=1.1 && <1.3) [details]|
|Copyright||(C) 2015 John MacFarlane|
|Source repo||head: git clone git://github.com/jgm/cmark-hs.git|
|Uploaded||by JohnMacFarlane at Mon Mar 16 06:21:52 UTC 2015|
|Distributions||Debian:0.5.6, Fedora:0.5.6.3, FreeBSD:0.4.0.1, LTSHaskell:0.5.6.3, NixOS:0.6, Stackage:0.6|
|Downloads||27807 total (688 in the last 30 days)|
|Rating||2.0 (votes: 1) [estimated by rule of succession]|
Docs available [build log]
Last success reported on 2015-03-16 [all 1 reports]
For package maintainers and hackage trustees