#[non_exhaustive]pub struct WriterOptions {Show 15 fields
pub extensions: Extensions,
pub wrap: WrapMode,
pub columns: Option<usize>,
pub number_sections: bool,
pub toc: bool,
pub toc_depth: Option<usize>,
pub math_method: MathMethod,
pub standalone: bool,
pub template: Option<String>,
pub template_dir: Option<PathBuf>,
pub template_ext: Option<String>,
pub variables: Vec<(String, String)>,
pub metadata: BTreeMap<String, MetaValue>,
pub metadata_defaults: BTreeMap<String, MetaValue>,
pub source_name: Option<String>,
}Expand description
Options controlling a Writer. Extended (not resignatured) as real options land.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.extensions: ExtensionsFormat extensions to enable.
wrap: WrapModeHow paragraphs are laid out: reflowed to the fill column, never wrapped, or with the source’s own line breaks preserved.
columns: Option<usize>The fill column a wrapping writer reflows to under WrapMode::Auto. None uses the
writer’s built-in default width.
number_sections: boolSplice a hierarchical section number into each heading. A format that numbers headings with a
typesetting counter applies it through its template instead (see
Writer::numbers_sections_natively).
toc: boolEmit a table of contents in a standalone document.
toc_depth: Option<usize>The deepest heading level the table of contents includes. None uses the conventional depth
of three.
math_method: MathMethodHow math is presented by a format offering a choice of renderers (the HTML family).
standalone: boolEmit a complete document by wrapping the rendered body in the target format’s template, rather than a bare fragment.
template: Option<String>Template source overriding the format’s built-in default. Its presence implies standalone output.
template_dir: Option<PathBuf>Directory used to resolve template partials ($name()$).
template_ext: Option<String>Extension a partial ($name()$) inherits from the including template: the --template
file’s own extension, so the same partial name resolves to the same kind of file whatever
the output format. An empty string means the template file had no extension (the partial is
looked up bare). Absent for a built-in default, where the format name is used instead.
variables: Vec<(String, String)>Raw template variables, in order; a repeated key accumulates into a list. Inserted verbatim (unescaped) at the highest precedence when building the template context.
metadata: BTreeMap<String, MetaValue>Metadata layered above the document’s own (the -M layer): each key replaces the reader’s
value for that key when the context is built.
metadata_defaults: BTreeMap<String, MetaValue>Metadata layered below the document’s own (the metadata-file layer): supplies defaults the
reader’s values and -M override.
source_name: Option<String>The source name an HTML-family standalone document falls back to for its pagetitle when no
title metadata is present: an input file’s stem, or - for standard input. None outside
the command line, where there is no source name and the fallback is empty.
Trait Implementations§
Source§impl Clone for WriterOptions
impl Clone for WriterOptions
Source§fn clone(&self) -> WriterOptions
fn clone(&self) -> WriterOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more