pub enum CaptionParent {
Body,
Container,
ContainerAfter,
Item,
}Expand description
Where a picture’s or table’s caption text item hangs in the docling-JSON
tree (#390). docling’s backends do not agree, and the JSON structure is
the only surface that shows it (Markdown, DocLang and LaTeX place a
caption by its item, whatever its parent): the PDF pipeline parents a
layout caption to the picture or table it belongs to, while every
declarative backend creates the caption with doc.add_text(label=CAPTION)
and no parent — the document body — even when the item itself sits in a
group or under a section header (JATS, LaTeX, HTML, Markdown, EPUB,
AsciiDoc all do). The office backends hang a chart’s title caption off the
chart’s container (the sheet group, the slide, docx’s current parent,
docling#4190) — that is Node::Chart’s own path, not this choice. A
backend that adds a new captioned item picks the variant matching
upstream’s add_text call for that format; the default is upstream’s
default.
Variants§
Body
#/body, listed after the enclosing top-level item — docling’s
add_text default, which every declarative backend leaves alone.
Container
The item’s own container (its parent), listed ahead of the item:
the caption is created first, as docling’s office backends do.
ContainerAfter
The item’s own container, listed after the item: docling’s HTML
backend adds a <figure>-wrapped table, then its <figcaption> under
self.parents[self.level] (docling#4050).
Item
The item itself — the caption is the picture’s or table’s first child, as docling’s PDF pipeline attaches a layout caption.
Trait Implementations§
Source§impl Clone for CaptionParent
impl Clone for CaptionParent
Source§fn clone(&self) -> CaptionParent
fn clone(&self) -> CaptionParent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CaptionParent
Source§impl Debug for CaptionParent
impl Debug for CaptionParent
Source§impl Default for CaptionParent
impl Default for CaptionParent
Source§fn default() -> CaptionParent
fn default() -> CaptionParent
impl Eq for CaptionParent
Source§impl PartialEq for CaptionParent
impl PartialEq for CaptionParent
impl StructuralPartialEq for CaptionParent
Auto Trait Implementations§
impl Freeze for CaptionParent
impl RefUnwindSafe for CaptionParent
impl Send for CaptionParent
impl Sync for CaptionParent
impl Unpin for CaptionParent
impl UnsafeUnpin for CaptionParent
impl UnwindSafe for CaptionParent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.