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