gleamcms/content/ast

Abstract Syntax Tree definitions for structured content. Deconstructs Markdown and Rich Text into typed, immutable values.

Types

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)))
  • HorizontalRule
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

  • Text(content: String)
  • Bold(children: List(Inline))
  • Italic(children: List(Inline))
  • Code(content: String)
  • Link(text: String, href: String)
  • Image(alt: String, src: String)
Search Document