pub enum Block {
Heading {
level: u8,
lemma: String,
},
Paragraph {
text: String,
},
Text {
text: String,
},
Open {
kind: Container,
lemma: Option<String>,
},
Close {
hypograph: Option<String>,
},
Verbatim {
lang: Option<String>,
text: String,
},
Table {
lemma: Option<String>,
headers: Option<Vec<String>>,
rows: Vec<Vec<String>>,
},
}Expand description
A block-level event in the text-level vocabulary — what a format producer emits. Headings arrive flat; the section tree is derived here, once, for every producer.
Variants§
Heading
A flat heading: level is the source level (h2 → 2, a
LaTeX \section → its depth), lemma its text.
Paragraph
A plain paragraph — the implicit, lemma-less block.
Text
Inline content belonging directly to the open container (a list item’s own text, a bare-text blockquote). With no open container it is read as a paragraph.
Open
Open a nesting container. Items take their unordered- /
ordered- flavor (and taxis) from the enclosing list.
Close
Close the innermost open container, optionally with its hypograph (footer or attribution).
Verbatim
A verbatim block — code or other preformatted lines, kept as authored.
Table
A table, denormalized here into nested lists (rows =
ordered items, cells = unordered items, Header: value
when headers is present). Header detection is the
producer’s job; the lowering rule lives here.