Abstract Syntax Tree definitions for structured content.
Deconstructs Markdown and Rich Text into typed, immutable values.
pub type Block {
Heading(level: Int, children: List(Inline))
Paragraph(children: List(Inline))
CodeBlock(language: String, code: String)
BlockQuote(children: List(Inline))
UnorderedList(items: List(List(Inline)))
OrderedList(items: List(List(Inline)))
HorizontalRule
}
Constructors
-
Heading(level: Int, children: List(Inline))
-
Paragraph(children: List(Inline))
-
CodeBlock(language: String, code: String)
-
BlockQuote(children: List(Inline))
-
UnorderedList(items: List(List(Inline)))
-
OrderedList(items: List(List(Inline)))
-
pub type Document {
Document(blocks: List(Block))
}
Constructors
-
Document(blocks: List(Block))
pub type Inline {
Text(content: String)
Bold(children: List(Inline))
Italic(children: List(Inline))
Code(content: String)
Link(text: String, href: String)
Image(alt: String, src: String)
}
Constructors
-
-
-
Italic(children: List(Inline))
-
-
Link(text: String, href: String)
-
Image(alt: String, src: String)