Skip to main content

Module style

Module style 

Source
Expand description

Document style spec.

Loaded either from a TOML file (Style::from_toml_str / Style::from_toml_file) or built from the in-code Default impl. All fields are #[serde(default)] so partial overrides are easy: a TOML file can specify just the page size and inherit everything else.

Structs§

CalloutStyle
CalloutStyles
CodeHighlightStyle
Per-token-class colour palette for the built-in syntax highlighter. Token classes a language doesn’t produce simply go unused; languages without a recognised name (or language attribute) fall back to code_text_color.
ColorRgb
CoverPageStyle
FootnoteStyle
Per-page footnote pool styling.
FrontmatterColumn
One column of a FrontmatterTable.
FrontmatterTable
One entry of Style::frontmatter_tables: where the rows of a table come from, its columns, and the heading above it.
HeaderFooterSlots
Just the three slot templates — used for even-page variants and per-chapter overrides. Empty fields fall back to the parent HeaderFooterStyle’s slot.
HeaderFooterStyle
HeadingNumbering
Automatic section numbering for headings (1, 1.1, 1.1.1, …).
HeadingStyle
HeadingStyles
HyphenationStyle
Word-hyphenation settings. When enabled, the renderer pre-walks body text and inserts soft hyphens (U+00AD) at every Knuth–Liang hyphenation point for the configured language. parley breaks lines at those points when needed and the hyphens stay invisible otherwise.
LastPageQr
A small QR code stamped in a bottom corner of the last page (per align) that carries content, above a human-readable label. value and label are templates (default "{documentNumber}", resolved against the document’s frontmatter and the usual {page}/{title}/… tokens); a value that doesn’t resolve (no such field) skips the stamp entirely, and an empty resolved label hides the caption. A field whose value is one of missing_values counts as not set.
LinkStyle
How [text](url) links are visually distinguished from body text. The PDF link annotation is created regardless of these settings; these only affect the glyphs underneath so readers spot the link without hovering.
ListMarkerStyle
Styling for list-item markers. Bullets (unordered lists) are unaffected; these knobs shape ordered-list numbering and the optional circular badge treatment.
ListSectionStyle
Generic auto-generated list section: List of Figures, List of Tables. Same shape as a TOC but flat (no level indenting). The title field is optional so callers can omit it from TOML and let the renderer pick a sensible default per section (“List of Figures” for lof, “List of Tables” for lot).
LogoSpec
A header/footer logo: an asset URI plus the rendered display size in PDF points. The renderer decodes the asset once per document and caches the result by URI, so repeating the same logo across pages costs the same as decoding it for one page.
NoticeBanner
A masthead drawn at the top of every page: a logo (with an optional subtitle beneath it) on the left, a wrapping disclaimer paragraph below them, an icon on the right whose label is centred beneath it just above an optional note line + full-width rule closing the band.
PageDecorationStyle
Page-level header/footer decoration. Both are optional — by default no decoration is drawn, matching the previous behaviour.
PageLayoutStyle
Style
TocStyle
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).
Watermark
A page-level watermark. Use the kind field to pick image vs text.
WatermarkImage
WatermarkText

Enums§

CalloutDecoration
How a callout is framed.
CaptionPosition
Where the visual caption block sits relative to its figure or table. Applies to both {% caption %}-attached and alt-derived captions.
CoverAlign
Horizontal alignment of the cover-page text blocks.
LogoPosition
Synthesised cover/title page placed before any body content. The renderer pulls title / description / authors / date from RenderContext (which the CLI populates from frontmatter), plus an optional logo image. Disabled by default — most documents don’t need a cover page.
MarkerSequence
Ordered-list numbering style for one nesting level. Mirrors the CSS list-style-type values of the same name.
PdfExportProfile
PDF export profile — selects the krilla validator and provides document-metadata defaults that the renderer applies via RenderContext.
StyleLoadError
TableBorders
Which rules a table draws.
TableColumnSizing
Strategy for sizing table columns.
TextAlign
Horizontal alignment for body prose. Mirrors CSS text-align.
TocPosition
WatermarkKind