README.md
# Discount.ex
[](https://hex.pm/packages/discount)
[](https://github.com/asaaki/discount.ex/blob/master/LICENSE)
[](https://travis-ci.org/asaaki/discount.ex)
[](https://gratipay.com/asaaki)
Elixir NIF for **discount**, a Markdown parser ([GH: Orc/discount](https://github.com/Orc/discount)).
----
**I recommend to use a strongly specified implementation of Markdown called CommonMark!**
An Elixir library exists at [GitHub: asaaki/cmark.ex](https://github.com/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`)
```elixir
{ :discount, "~> 0.7" }
```
## Use
```shell
make
iex -S mix
```
```elixir
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
[MIT/X11](./LICENSE)
Copyright (c) 2013—2015 Christoph Grabo