
Syntax.pudu
Pudu76 lines2.8 KB
1/** @Docgen.Markdown.Syntax — article tree shared by parsing and rendering */2module PuduLangDocgen.Markdown.Syntax34/** @Docgen.Markdown.Target — a link or image destination as written */5export type Target = { destination: Str, title: Str, line: Int }67/** @Docgen.Markdown.XrefSpan — a cross reference by identity with optional display text */8export type XrefSpan = { uid: Str, text: Array[Inline], display: Str, line: Int, optional: Bool }910/** @Docgen.Markdown.Inline — phrasing content inside one block */11export type Inline12 = Text(Str)13 | Code(Str)14 | Emphasis(Array[Inline])15 | Strong(Array[Inline])16 | Strike(Array[Inline])17 | Subscript(Array[Inline])18 | Superscript(Array[Inline])19 | Inserted(Array[Inline])20 | Marked(Array[Inline])21 | Note(Str)22 | Anchor(Target, Array[Inline])23 | Picture(Target, Str)24 | Xref(XrefSpan)25 | Math(Str)26 | Markup(Str)27 | LineBreak28 | SoftBreak29 | Fragment(Str, Array[Inline])3031/** @Docgen.Markdown.Title — a section heading with an optional explicit fragment */32export type Title = { level: Int, content: Array[Inline], id: Str, line: Int }3334/** @Docgen.Markdown.Sample — code with language, caption, and emphasized lines */35export type Sample = { language: Str, title: Str, text: Str, highlight: Array[Int], line: Int }3637/** @Docgen.Markdown.Item — one list entry; checked is -1 without a box, 0 open, 1 done */38export type Item = { checked: Int, blocks: Array[Block] }3940/** @Docgen.Markdown.Listing — ordered or bullet list with its first number */41export type Listing = { ordered: Bool, start: Int, tight: Bool, items: Array[Item] }4243/** @Docgen.Markdown.Table — header and body cells with per-column alignment */44export type Table = { align: Array[Str], header: Array[Array[Inline]], rows: Array[Array[Array[Inline]]] }4546/** @Docgen.Markdown.Notice — highlighted aside such as a note or warning */47export type Notice = { kind: Str, blocks: Array[Block] }4849/** @Docgen.Markdown.Tab — one titled panel; tabs sharing an id switch together */50export type Tab = { id: Str, title: Str, condition: Str, blocks: Array[Block] }5152/** @Docgen.Markdown.Column — one cell of a row layout spanning grid units */53export type Column = { span: Int, blocks: Array[Block] }5455/** @Docgen.Markdown.Figure — an image with alternate text, kind, and optional caption */56export type Figure = { source: Str, alt: Str, kind: Str, lightbox: Str, caption: Array[Block], line: Int }5758/** @Docgen.Markdown.Block — structural content of an article */59export type Block60 = Heading(Title)61 | Paragraph(Array[Inline])62 | CodeBlock(Sample)63 | Quote(Array[Block])64 | ListBlock(Listing)65 | TableBlock(Table)66 | Rule67 | HtmlBlock(Str)68 | Alert(Notice)69 | TabGroup(Array[Tab])70 | Included(Str, Array[Block])71 | Video(Str)72 | MathBlock(Str)73 | Grid(Array[Column])74 | Image(Figure)75 | Footnote(Str, Array[Block])76