MobileDoc HTML Renderer for Elixir
Similarly to MobileDoc HTML Renderer, this an HTML renderer for the MobileDoc format used by the ContentKit editor, written in Elixir.
First, add MobileDoc to your mix.exs
dependencies:
def deps do
[{:mobiledoc, ">= 0.0.1"}]
end
Then, update your dependencies:
$ mix deps.get
mobiledoc = Poison.decode!(~s(
{
"version": "0.2.0",
"sections": [
[
["B"]
],
[
[1, "P", [
[[0], 0, "hello world"]
]]
]
]
}
))
rendered = MobileDoc.Renderer.render(mobiledoc)
# renders <div><p><b>hello world</b></b></div>