A pure Elixir library for structured document representation with rich text support.
Documents are trees of nodes represented as tuples: {type, attrs, children}
Quick Start
# Create a simple document
doc = Quillon.document([
Quillon.heading(1, "Welcome"),
Quillon.paragraph("Hello world!")
])
# Convert to JSON
json = Quillon.to_json(doc)
# Parse from JSON
{:ok, doc} = Quillon.from_json(json)Node Types
- Container:
:document - Block:
:paragraph,:heading,:divider,:blockquote,:callout,:code_block,:image,:video,:bullet_list,:ordered_list,:table - List content:
:list_item - Table content:
:table_row,:table_cell - Inline:
:text
Marks
Marks apply formatting to text nodes:
- Simple marks:
:bold,:italic,:underline,:strike,:code - Attributed marks:
{:link, %{href: "..."}}
Summary
Functions
See Quillon.Node.attrs/1.
See Quillon.Path.get/2.
See Quillon.Node.list?/1.
See Quillon.Mark.mark?/1.
See Quillon.Path.move/3.
See Quillon.Node.node?/1.
See Quillon.Node.text?/1.
See Quillon.Node.type/1.