#[non_exhaustive]pub struct WriterOptions {Show 18 fields
pub extensions: Extensions,
pub media: Arc<MediaBag>,
pub epub: EpubOptions,
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_datadir: 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.
media: Arc<MediaBag>The embedded resources the document references by name but does not carry inline. A writer that re-embeds resource bytes — a notebook re-encoding its image outputs — reads them from here; most writers ignore it. Shared cheaply, so cloning the options does not copy the bytes.
epub: EpubOptionsOptions for the EPUB container writer; ignored by every other writer.
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: booltemplate only.Emit a complete document by wrapping the rendered body in the target format’s template, rather than a bare fragment.
template: Option<String>template only.Template source overriding the format’s built-in default. Its presence implies standalone output.
template_dir: Option<PathBuf>template only.Directory used to resolve template partials ($name()$).
template_datadir: Option<PathBuf>template only.A shared directory of partials ($name()$) consulted when a partial is not found beside the
including template — the data directory’s templates/. None when no data directory applies.
template_ext: Option<String>template only.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)>template only.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>template only.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>template only.Metadata layered below the document’s own (the metadata-file layer): supplies defaults the
reader’s values and -M override.
source_name: Option<String>container or template only.The source name a standalone document falls back to 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. Consumed by the HTML family (for its pagetitle)
and by the container writer (for the navigation document’s title).
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