pub enum Node {
Heading {
level: u8,
text: String,
},
Paragraph {
text: String,
},
ListItem {
ordered: bool,
number: u64,
first_in_list: bool,
text: String,
level: u8,
marker: Option<String>,
},
Code {
language: Option<String>,
text: String,
},
Table(Table),
Picture {
caption: Option<String>,
image: Option<PictureImage>,
},
Group {
label: String,
children: Vec<Node>,
},
FieldRegion {
items: Vec<FieldItem>,
},
InlineGroup {
unwrapped: bool,
runs: Vec<InlineRun>,
md_text: String,
},
Furniture(Box<Node>),
Located {
location: [u16; 4],
inner: Box<Node>,
},
}Expand description
A single piece of document content.
Variants§
Heading
A heading. level is 1-6.
Paragraph
A run of body text.
ListItem
A single list item at the given nesting level (0 = top). For ordered
items, number is the display number (honoring the list’s start); it
is unused for unordered items. first_in_list marks the first item of a
list so the serializer can blank-line-separate adjacent sibling lists.
marker is the DocLang enumeration marker ("1.", "1.1.", …) when the
backend provides one — HTML and DOCX set it for enumerated items, so
DocLang emits <ldiv><marker>…</marker></ldiv>; Markdown and the other
declarative backends leave it None, giving a bare <ldiv/> (matching
docling, whose Markdown backend passes no marker).
Code
A fenced code block.
Table(Table)
A table. The first row is treated as the header.
Picture
A picture/figure, with an optional caption and (when a backend extracts it) the embedded image itself.
Group
A logical grouping of child nodes (e.g. a list, a section).
FieldRegion
A form key-value region (docling’s field_region): a set of form fields,
each pairing an optional marker, key, and value. Backends detect these
from form structure (e.g. HTML’s keyN / keyN_valueM / keyN_marker
id-convention); the serializers render each item’s parts as separate
labelled texts (marker / field_key / field_value).
InlineGroup
Rich inline content — docling’s InlineGroup: a run of styled text
segments that a backend captured with formatting (<bold>, <italic>,
<underline>, <strikethrough>, sub/superscript, inline <code>) the
flat Markdown text cannot represent. Markdown/JSON render this exactly
like Paragraph { text: md_text } (so their output is unchanged); the
DocLang serializer uses the structured runs. unwrapped is set when the
group’s docling parent is a heading/text (no enclosing <text> wrapper).
Furniture(Box<Node>)
A node in docling’s furniture content layer (page headers/footers, the
HTML <title>, …). Markdown and JSON omit furniture by default; DocLang
renders the wrapped node with a <layer value="furniture"/> head.
Located
A node carrying layout provenance — the four DocLang <location> values
(x0,y0,x1,y1, normalized to 0–511) docling attaches to elements from
backends with real geometry (e.g. the slide shapes in PPTX). Markdown and
JSON render the wrapped node unchanged; DocLang emits the <location>
tokens as the element’s first children.