Cmark
Elixir NIF for cmark (C), a parser library following the CommonMark spec.
CommonMark
A strongly specified, highly compatible implementation of Markdown
For more information visit http://commonmark.org/.
Install
Prerequisites
You need a C compiler like gcc or clang.
mix.exs
Add this to your dependencies:
{:cmark, "~> 0.6"}Usage
Quick example
Cmark.to_html "a markdown string"
#=> "<p>a markdown string</p>\n"More detailed documentation at http://hexdocs.pm/cmark/.
Available functions
HTML
Cmark.to_html/1Cmark.to_html/2Cmark.to_html/3Cmark.to_html_each/2Cmark.to_html_each/3
XML
Cmark.to_xml/1Cmark.to_xml/2Cmark.to_xml/3Cmark.to_xml_each/2Cmark.to_xml_each/3
Manpage
Cmark.to_man/1Cmark.to_man/2Cmark.to_man/3Cmark.to_man_each/2Cmark.to_man_each/3
CommonMark
Cmark.to_commonmark/1Cmark.to_commonmark/2Cmark.to_commonmark/3Cmark.to_commonmark_each/2Cmark.to_commonmark_each/3
LaTeX
Cmark.to_latex/1Cmark.to_latex/2Cmark.to_latex/3Cmark.to_latex_each/2Cmark.to_latex_each/3
Documentation
Latest API docs can be found at: http://hexdocs.pm/cmark/Cmark.html
Licenses
- Cmark.ex: LICENSE (MIT)
- cmark (C): c_src/COPYING (multiple)