pub struct HeadingNumbering {
pub enabled: bool,
pub max_depth: u8,
pub separator: String,
}Expand description
Automatic section numbering for headings (1, 1.1, 1.1.1, …).
Off by default — themes that don’t opt in render headings exactly as
before. When enabled, the computed prefix is baked into the heading
text itself, so it flows automatically into the visible heading, the
running header ({chapter} / {section}), and the table of contents.
Only levels 1..=max_depth are numbered; deeper headings render
unprefixed (a common convention — e.g. number chapters/sections but
leave sub-sub-subsections plain). An individual heading opts out by
carrying an anchor tag with numbered="false"
(## Copyright {% tag numbered="false" /%}) — used for front-matter
sections (copyright, preface) that should precede 1. without
consuming a number.
Fields§
§enabled: boolMaster switch. When false (the default) no numbering happens.
max_depth: u8Deepest heading level that receives a number. 3 numbers
h1/h2/h3 and leaves h4+ plain. Clamped to 1..=6.
separator: StringString placed between the last number and the heading text.
Defaults to a single space ("1.2 Title"); set to e.g. ". "
for "1.2. Title".
Trait Implementations§
Source§impl Clone for HeadingNumbering
impl Clone for HeadingNumbering
Source§impl Debug for HeadingNumbering
impl Debug for HeadingNumbering
Source§impl Default for HeadingNumbering
impl Default for HeadingNumbering
Source§impl<'de> Deserialize<'de> for HeadingNumberingwhere
HeadingNumbering: Default,
impl<'de> Deserialize<'de> for HeadingNumberingwhere
HeadingNumbering: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Forget for HeadingNumbering
impl Freeze for HeadingNumbering
impl Move for HeadingNumbering
impl RefUnwindSafe for HeadingNumbering
impl Send for HeadingNumbering
impl Sync for HeadingNumbering
impl Unpin for HeadingNumbering
impl UnsafeUnpin for HeadingNumbering
impl UnwindSafe for HeadingNumbering
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.