mork/document

Types

pub type Block {
  ThematicBreak
  Heading(level: Int, text: List(Inline))
  Code(lang: option.Option(String), text: List(Inline))
  Paragraph(text: List(Inline))
  BlockQuote(blocks: List(Block))
  MdList(style: ListStyle, pack: ListPack, items: List(ListItem))
  HtmlBlock(raw: String)
  Newline
  Empty
}

Constructors

pub type Destination {
  Absolute(uri: String)
  Relative(uri: String)
  Anchor(id: String)
}

Constructors

  • Absolute(uri: String)
  • Relative(uri: String)
  • Anchor(id: String)
pub type Document {
  Document(
    blocks: List(Block),
    links: dict.Dict(String, LinkData),
    footnotes: dict.Dict(String, FootnoteData),
  )
}

Constructors

pub type FootnoteData {
  FootnoteData(num: Int, blocks: List(Block))
}

Constructors

  • FootnoteData(num: Int, blocks: List(Block))
pub type Inline {
  CodeSpan(String)
  Emphasis(List(Inline))
  Strong(List(Inline))
  RefLink(text: List(Inline), label: String)
  RefImage(text: List(Inline), label: String)
  FullLink(text: List(Inline), data: LinkData)
  Footnote(num: Int, label: String)
  InlineFootnote(num: Int, text: List(Inline))
  FullImage(text: List(Inline), data: LinkData)
  Autolink(uri: String)
  EmailAutolink(mail: String)
  InlineHtml(
    tag: String,
    attrs: dict.Dict(String, String),
    children: List(Inline),
  )
  HardBreak
  SoftBreak
  Text(String)
  RawHtml(String)
  RawText(String)
  UnparsedInline(String)
  UnparsedCode(String)
  Delim(style: String, len: Int, can_open: Bool, can_close: Bool)
}

Constructors

  • CodeSpan(String)
  • Emphasis(List(Inline))
  • Strong(List(Inline))
  • RefLink(text: List(Inline), label: String)
  • RefImage(text: List(Inline), label: String)
  • FullLink(text: List(Inline), data: LinkData)
  • Footnote(num: Int, label: String)
  • InlineFootnote(num: Int, text: List(Inline))
  • FullImage(text: List(Inline), data: LinkData)
  • Autolink(uri: String)
  • EmailAutolink(mail: String)
  • InlineHtml(
      tag: String,
      attrs: dict.Dict(String, String),
      children: List(Inline),
    )
  • HardBreak
  • SoftBreak
  • Text(String)
  • RawHtml(String)
  • RawText(String)
  • UnparsedInline(String)
  • UnparsedCode(String)
  • Delim(style: String, len: Int, can_open: Bool, can_close: Bool)
pub type LinkData {
  LinkData(dest: Destination, title: option.Option(String))
}

Constructors

pub type ListItem {
  ListItem(
    blocks: List(Block),
    ends_with_blank: Bool,
    contains_blank: Bool,
  )
}

Constructors

  • ListItem(
      blocks: List(Block),
      ends_with_blank: Bool,
      contains_blank: Bool,
    )
pub type ListItemInfo {
  EndsWithBlank
  ContainsBlank
}

Constructors

  • EndsWithBlank
  • ContainsBlank
pub type ListPack {
  Loose
  Tight
}

Constructors

  • Loose
  • Tight
pub type ListStyle {
  BulletList
  OrderedList(start: option.Option(Int))
}

Constructors

Values

pub fn lookup_link(
  doc: Document,
  label: String,
) -> Result(LinkData, Nil)
pub fn new() -> Document
pub fn new_destination(uri: String) -> Destination
Search Document