Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/asaaki/discount.ex

Elixir NIF for discount, a Markdown parser
https://github.com/asaaki/discount.ex

Last synced: 7 days ago
JSON representation

Elixir NIF for discount, a Markdown parser

Awesome Lists containing this project

README

        

# Discount.ex

[![Hex.pm package version](https://img.shields.io/hexpm/v/discount.svg?style=flat-square)](https://hex.pm/packages/discount)
[![Hex.pm package license](https://img.shields.io/hexpm/l/discount.svg?style=flat-square)](https://github.com/asaaki/discount.ex/blob/master/LICENSE)
[![Build Status (master)](https://img.shields.io/travis/asaaki/discount.ex/master.svg?style=flat-square)](https://travis-ci.org/asaaki/discount.ex)
[![Support via Gratipay](http://img.shields.io/gratipay/asaaki.svg?style=flat-square)](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 .

More about the reason can be read at .

----

## Add dependency (with `hex`)

```elixir
{ :discount, "~> 0.7" }
```

## Use

```shell
make
iex -S mix
```

```elixir
Discount.to_html "## markdown string"
#=> "

markdown string

"

# 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