pub enum HeadingDepth {
Docling,
Source,
}Expand description
How a section_header’s level becomes a Pandoc Header depth (#848).
Variants§
Docling
docling’s convention, the default: Header 1 is the document title
and a section_header of level n is Header (n+1) (capped at 6),
the depth docling’s Markdown and HTML serializers give it (## for
level 1). The flat Node::Heading round trip relies on it — a
level-2 heading is stored as a level-1 section_header and comes
back as Header 2 — as do consumers of docling’s JSON, so it is not
changed under them.
Source
The source’s own depth: a section_header of level n is Header n
(clamped to 1–6; a missing or zero level is 1) and the title stays
Header 1 — what Pandoc’s own docx / odt readers give (a DOCX
Heading 1 is Header 1), so --number-sections, TOC depths and
--shift-heading-level-by behave as on pandoc -f docx. A document
whose backend reserves level 1 for the title (HTML, Markdown: an
<h2> is a level-1 section_header) comes out one depth shallower
under it.
Implementations§
Trait Implementations§
Source§impl Clone for HeadingDepth
impl Clone for HeadingDepth
impl Copy for HeadingDepth
Source§impl Debug for HeadingDepth
impl Debug for HeadingDepth
Source§impl Default for HeadingDepth
impl Default for HeadingDepth
impl Eq for HeadingDepth
Source§impl FromStr for HeadingDepth
impl FromStr for HeadingDepth
Source§impl PartialEq for HeadingDepth
impl PartialEq for HeadingDepth
impl StructuralPartialEq for HeadingDepth
Auto Trait Implementations§
impl Freeze for HeadingDepth
impl RefUnwindSafe for HeadingDepth
impl Send for HeadingDepth
impl Sync for HeadingDepth
impl Unpin for HeadingDepth
impl UnsafeUnpin for HeadingDepth
impl UnwindSafe for HeadingDepth
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.