libcmark wrapper for Nim.
nim-cmark requires that libcmark is installed and the shared library is available.
macOS
brew install cmark
Ubuntu
sudo apt install libcmark-dev
Windows
Refer to https://github.com/commonmark/cmark#installing-windows.
import cmark
let markdown = """
# hello
```nim
echo "hello world"
```
"""
echo markdown_to_html(markdown, CMARK_OPT_DEFAULT)
Got output:
<h1>hello</h1>
<pre><code class="language-nim">echo "hello world"
</code></pre>
All code is released under the Apache-2.0 license.