Skip to main content

Module tree

Module tree 

Source
Expand description

docling’s item tree, for a backend that knows the exact shape upstream gives a document and wants the JSON export to reproduce it.

DoclingDocument::nodes is a flat, reading-order stream tuned for Markdown / DocLang / LaTeX; the JSON export rebuilds docling’s parent/child structure from it with generic rules (runs of list items become list groups, a heading is a flat sibling of the text that follows it). Upstream’s backends do not all agree on that structure: the HTML backend nests everything after a heading under the heading, splits a paragraph of mixed formatting into an inline group of one text item per formatting run, parents a rich table cell’s content to a group under the table, keeps site chrome on the furniture layer… and numbers every item in the order it creates them. A backend that ports those rules call-for-call (HTML’s html_tree.rs, DOCX’s docx_tree.rs) records the result here — an arena of items in creation order, each with its parent and children — and the JSON export (DoclingDocument::export_to_json) serializes this tree instead of deriving one from the nodes. Every other serializer keeps reading the flat nodes, so their output is unaffected.

Structs§

Formatting
docling-core’s Formatting: the inline styles an item carries in JSON.
ItemTree
docling’s item tree in creation order (see the module docs).
ListMeta
A list_item’s docling fields.
TreeItem
One item of an ItemTree.
TreeProv
docling’s ProvenanceItem for a tree item, written verbatim: the backend’s own geometry in the page’s units — a PPTX shape’s EMU box, whose pages entry is the slide size in EMU — rather than the 0–511 DocLang grid the flat Node::Located carries (which cannot round-trip those integers).

Enums§

TreeKind
What an item in the tree is. Mirrors the docling-core item classes the JSON texts / groups / tables / pictures / field_regions buckets hold.