pub struct TreeItem {Show 13 fields
pub parent: Option<usize>,
pub children: Vec<usize>,
pub layer: Option<ContentLayer>,
pub kind: TreeKind,
pub prov: Option<TreeProv>,
pub comments: Vec<usize>,
pub source: Option<TreeTrack>,
pub deleted: bool,
pub notes: Vec<TreeNote>,
pub note_body: bool,
pub anchors: Vec<String>,
pub number: Option<String>,
pub revision: Option<Revision>,
}Expand description
One item of an ItemTree.
Fields§
§parent: Option<usize>The parent item’s index; None = the document body.
children: Vec<usize>Child item indices, in docling’s children order.
layer: Option<ContentLayer>The content layer; None = body.
kind: TreeKind§prov: Option<TreeProv>The item’s prov entry, when the backend has page geometry for it
(None → prov: [], what the HTML and DOCX backends write).
comments: Vec<usize>docling’s DocItem.comments: the comment_section groups (or note
text items) annotating this item, as item indices — written after
prov when non-empty.
source: Option<TreeTrack>docling’s DocItem.source: the track segment a text item was taken
from (WebVTT cues) — written after prov when set.
deleted: boolRemoved by ItemTree::delete (docling’s delete_items): the slot
stays so every other index keeps its meaning, but the item is not
numbered or written.
notes: Vec<TreeNote>Footnotes / endnotes referenced from inside this text item (#538): the
note call’s position (chars into the item’s text) and the note’s text.
docling keeps notes as unlinked furniture footnote items, so the
JSON never shows this; the Pandoc AST writes each as a Note there.
note_body: boolThis furniture footnote item is the body of a note some text item
calls (it travels in that item’s Self::notes); the Pandoc AST then
leaves it out as a standalone block.
anchors: Vec<String>Link destinations at this item (#849): the identifiers a document’s
internal links (hyperlink: "#id") point at — a DOCX bookmark in
a heading, say. docling’s model has no slot for them, so the JSON
shows them only on the Pandoc path (_anchors), where a heading’s
first one is its Header id and the rest empty Span .anchors.
number: Option<String>The generated numbering text opens with, when the backend put one
there (#850: a DOCX heading numbered through w:numPr is docling’s
1.2 Title): "1.2" — the authored text follows it after one
space. docling’s JSON keeps the numbered text; the Pandoc AST writes
the authored text alone (_number on that path), since Pandoc
numbers sections itself (--number-sections) and its docx reader
never writes the number into the Header.
revision: Option<Revision>The tracked change this run carries under
TrackChanges::All (#851): the Pandoc
AST wraps the run in Span .insertion / .deletion (_revision
on that path); docling’s JSON has no field for it.