std/markdown/tree
std/markdown/src/tree.trb
The document tree of Markdown: blocks, which hold blocks or inlines, and inlines, which hold text. It is a value - built by the parser, read by the HTML renderer and the writer, and changed by a program like any other value.
type MarkdownDocument
type MarkdownDocument
A parsed Markdown document: its blocks, and the front matter it starts with, if any.
field blocks
blocks: List<MarkdownBlock>
Not documented.
field frontMatter
frontMatter: FrontMatter? = None
Not documented.
type FrontMatter
type FrontMatter
The front matter of a document: the text between a first line --- and the next line --- or ..., which is
YAML. line is the line of its first line of text, counted from 1.
type MarkdownBlock
type MarkdownBlock
One block, and the lines it spans, counted from 1.
type BlockContent
type BlockContent
What a block is.
case Paragraph
case Paragraph(inlines: List<MarkdownInline>)
Not documented.
case Heading
case Heading(level: Int, inlines: List<MarkdownInline>)
# Title or a line underlined with = or -; level is 1 to 6.
case ThematicBreak
case ThematicBreak
Not documented.
case CodeBlock
case CodeBlock(info: String, text: String, fenced: Bool)
A fenced block with its info string, or an indented one, whose info string is empty.
case HtmlBlock
case HtmlBlock(html: String)
Not documented.
case BlockQuote
case BlockQuote(blocks: List<MarkdownBlock>)
Not documented.
case ItemList
case ItemList(list: MarkdownList)
Not documented.
case Table
case Table(table: MarkdownTable)
A table of GitHub Flavored Markdown.
type MarkdownList
type MarkdownList
A bullet list or an ordered list. marker is the bullet (-, +, *) or the delimiter after the number (.,
)); start is the first number of an ordered list. A list is tight when no blank line separates its items or the
blocks inside them, and a tight list's paragraphs are written without <p>.
type ListItem
type ListItem
One item of a list: the blocks it holds, and the line of its marker.
type ColumnAlignment
type ColumnAlignment
How a column of a table is aligned, as its delimiter row says.
case Unspecified
case Unspecified
Not documented.
case Left
case Left
Not documented.
case Center
case Center
Not documented.
case Right
case Right
Not documented.
type MarkdownTable
type MarkdownTable
A table: the alignment of each column, the cells of its header row, and the cells of each row after it.
field alignments
alignments: List<ColumnAlignment>
Not documented.
field header
header: List<List<MarkdownInline>>
Not documented.
field rows
rows: List<List<List<MarkdownInline>>>
Not documented.
type MarkdownInline
type MarkdownInline
What a paragraph, a heading or a cell holds. line of a link or an image is the line it starts on.
case Text
case Text(text: String)
Not documented.
case Code
case Code(text: String)
`code`: the text between the backticks.
case Emphasis
case Emphasis(children: List<MarkdownInline>)
Not documented.
case Strong
case Strong(children: List<MarkdownInline>)
Not documented.
case Link
case Link(destination: String, title: String, children: List<MarkdownInline>, line: Int)
Not documented.
case Image
case Image(destination: String, title: String, children: List<MarkdownInline>, line: Int)
Not documented.
case Html
case Html(html: String)
Raw HTML, written through as it is.
case SoftBreak
case SoftBreak
A line break that is only a break of the source: rendered as a line break of the output, or a space.
case HardBreak
case HardBreak
A line break that is one: two spaces or a \ at the end of the line.
fn plainText
fn plainText(inlines: List<MarkdownInline>): String
The text of inlines without their markup: what an image's alt is, and what a heading's anchor is made of.