Awesome
Discount.ex
Elixir NIF for discount, a Markdown parser (GH: Orc/discount).
I recommend to use a strongly specified implementation of Markdown called CommonMark!
An Elixir library exists at GitHub: asaaki/cmark.ex, the Hex package at https://hex.pm/packages/cmark.
More about the reason can be read at http://commonmark.org/.
Add dependency (with hex
)
{ :discount, "~> 0.7" }
Use
make
iex -S mix
Discount.to_html "## markdown string"
#=> "<h2>markdown string</h2>"
# Alternatively pass the compiled document to a function:
Discount.to_html "## markdown string", fn (html) ->
do_something_with(html)
end
License
Copyright (c) 2013—2015 Christoph Grabo