pub enum NodeKind {
Show 22 variants
Document,
Section,
Paragraph,
Text,
Emphasis,
Strong,
BoldItalic,
Math,
Equation,
Figure,
Image,
Table,
Citation,
Reference,
PageReference,
Theorem,
Footnote,
Bibliography,
Raw,
List,
ListItem,
HardBreak,
}Expand description
The kinds of nodes Mosaic recognises (manifest §5.1).
§Examples
use mos_core::NodeKind;
let kind = NodeKind::Paragraph;
assert_eq!(kind, NodeKind::Paragraph);Variants§
Document
Section
Paragraph
Text
Emphasis
Strong
BoldItalic
Math
Equation
Figure
A captioned container: an image plus a caption paragraph, laid
out together with the caption beneath. Cross-references via
@fig:foo will target this kind once MVP 3 lands.
Image
A raster image (PNG / JPEG in MVP 1.5). The decoded pixel data
and natural dimensions live on the node’s attributes; see the
mos-eval resolver for the exact attribute names.
Table
Citation
Reference
PageReference
A @page(label) reference to the printed page number of a labelled
target. Distinct from Reference (which resolves to
a section/figure number): a page reference resolves to where the target
lands, which is only known after layout, via the resolve↔layout fixpoint
(issue #72). Carries a label attribute and placeholder text; layout
renders the text attribute like any inline run.
Theorem
Footnote
Bibliography
Raw
List
A bullet or numbered list. The ordered attribute distinguishes
the two kinds and child nodes are NodeKind::ListItems.
ListItem
One entry inside a NodeKind::List. Inline children carry the
item’s text; nested NodeKind::List children describe deeper
levels.
HardBreak
\\: a forced line break inside a paragraph. Carries no
attributes; layout consumes it as a WordItem::HardBreak
sentinel in the inline word stream. A blank-line paragraph
break is not the same node: it ends the paragraph and
triggers paragraph-spacing leading, whereas HardBreak keeps
the same paragraph and applies normal inter-line leading.