pub struct TocStyle {
pub enabled: bool,
pub position: TocPosition,
pub title: String,
pub title_font_size: f32,
pub entry_font_size: f32,
pub entry_space_after: f32,
pub entry_indent_per_level: f32,
pub max_depth: u8,
pub font_families: Vec<String>,
}Expand description
Table of contents — generated from the document’s heading outline.
Disabled by default. When enabled, the TOC pages are inserted at
position and each entry links to its target heading via PDF
internal destinations (powered by the same anchor mechanism that
{% tagref %} uses, with synthetic anchor ids assigned to every
heading).
Fields§
§enabled: bool§position: TocPosition§title: StringTitle to render at the top of the TOC (e.g. “Table of Contents”).
title_font_size: f32Font size for the TOC’s title heading.
entry_font_size: f32Font size for individual entries.
entry_space_after: f32Vertical gap after each entry.
entry_indent_per_level: f32Horizontal indent applied per heading-level depth.
max_depth: u8Maximum heading level included (1 = h1 only, 6 = all).
font_families: Vec<String>Font families for this element, in fallback order. Empty means
“inherit the document body families” (body_font_families, or
the bundled Noto defaults when that is also empty). Names must
be families the font collection knows — either system-installed
or exposed by a file listed in font_paths.
Note this REPLACES the body list rather than extending it, so a Latin-only face here will lose the multi-script fallbacks. List the scripts you need explicitly if the document is not Latin-only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TocStyle
impl<'de> Deserialize<'de> for TocStyle
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 TocStyle
impl Freeze for TocStyle
impl Move for TocStyle
impl RefUnwindSafe for TocStyle
impl Send for TocStyle
impl Sync for TocStyle
impl Unpin for TocStyle
impl UnsafeUnpin for TocStyle
impl UnwindSafe for TocStyle
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.