pub struct FmtOptions { /* private fields */ }Expand description
Formatter knobs.
Style knobs default to Preserve except GFM tables, which default
to compact normal form. The structural-emit pipeline never consults
style knobs; rewrites are applied by the formatter’s rewrite-family
pipeline. Structural defaults: wrap = keep, trailing-newline = preserve, end-of-line = lf, empty exclude list.
Implementations§
Source§impl FmtOptions
impl FmtOptions
Sourcepub fn wrap_strategy(&self) -> WrapStrategy
pub fn wrap_strategy(&self) -> WrapStrategy
Paragraph wrap strategy.
Sourcepub fn italic(&self) -> ItalicStyle
pub fn italic(&self) -> ItalicStyle
Italic delimiter normalisation policy.
Sourcepub fn strong(&self) -> StrongStyle
pub fn strong(&self) -> StrongStyle
Strong-emphasis delimiter normalisation policy.
Sourcepub fn list_marker(&self) -> ListMarkerStyle
pub fn list_marker(&self) -> ListMarkerStyle
Unordered-list bullet normalisation policy.
Sourcepub fn list_continuation_indent(&self) -> ListContinuationIndent
pub fn list_continuation_indent(&self) -> ListContinuationIndent
List continuation indentation used when wrapping list-item paragraphs.
Sourcepub fn ordered_list(&self) -> OrderedListStyle
pub fn ordered_list(&self) -> OrderedListStyle
Ordered-list number normalisation policy.
Sourcepub fn table(&self) -> TableStyle
pub fn table(&self) -> TableStyle
GFM table canonicalisation policy.
Sourcepub fn trailing_newline(&self) -> TrailingNewline
pub fn trailing_newline(&self) -> TrailingNewline
Trailing-newline policy at the document boundary.
Sourcepub fn end_of_line(&self) -> EndOfLine
pub fn end_of_line(&self) -> EndOfLine
Line-ending normalisation policy.
Sourcepub fn exclude_globs(&self) -> &[String]
pub fn exclude_globs(&self) -> &[String]
Formatter-specific exclude globs (independent of [lint] exclude).
Sourcepub fn link_def_placement(&self) -> Placement
pub fn link_def_placement(&self) -> Placement
Where reference-link definitions are emitted: gathered + sorted at end of document, or kept in source positions.
Sourcepub fn link_def_style(&self) -> LinkDefStyle
pub fn link_def_style(&self) -> LinkDefStyle
Whether reference-link and inline-link destinations are emitted bare or angle-bracketed.
Sourcepub fn footnote_placement(&self) -> Placement
pub fn footnote_placement(&self) -> Placement
Where footnote definitions are emitted. Populated for parity
with Self::link_def_placement; session 11 reads this.
Sourcepub fn preserve_frontmatter(&self) -> bool
pub fn preserve_frontmatter(&self) -> bool
Whether to emit the document’s frontmatter byte-verbatim in
the formatted output. true (the default) preserves YAML or
TOML frontmatter exactly; false strips it.
Sourcepub fn thematic_break_style(&self) -> ThematicStyle
pub fn thematic_break_style(&self) -> ThematicStyle
Thematic-break canonicalisation policy. Defaults to
ThematicStyle::Preserve. The structural-emit path does not
consult this; a later canonicalisation post-pass will.
Sourcepub fn math(&self) -> MathOptions
pub fn math(&self) -> MathOptions
Math canonicalisation configuration. See MathOptions for the
reason every field defaults off.
Sourcepub fn with_math(self, math: MathOptions) -> Self
pub fn with_math(self, math: MathOptions) -> Self
Override the math options. Returns the receiver for chaining.
Sourcepub fn with_math_render(self, render: MathRender) -> Self
pub fn with_math_render(self, render: MathRender) -> Self
Override only the math render policy. Composes with the
existing MathOptions; preserves normalise.
Sourcepub fn heading_attrs(&self) -> HeadingAttrsStyle
pub fn heading_attrs(&self) -> HeadingAttrsStyle
Heading-attribute trailer emission policy.
Sourcepub fn with_heading_attrs(self, style: HeadingAttrsStyle) -> Self
pub fn with_heading_attrs(self, style: HeadingAttrsStyle) -> Self
Override the heading-attribute style.
Sourcepub fn resolve_italic(&self, source_delim: u8) -> u8
pub fn resolve_italic(&self, source_delim: u8) -> u8
Resolve the italic delimiter to emit, given the byte the
source originally used (b'*' or b'_'). Preserve returns
source_delim; fixed styles return their own byte. Keeps the
match out of every render site.
Sourcepub fn with_wrap(self, wrap: Wrap) -> Self
pub fn with_wrap(self, wrap: Wrap) -> Self
Override the wrap mode. Returns the receiver for chaining.
Used by callers that build FmtOptions programmatically
(benches, golden tests, --wrap overrides).
Sourcepub fn with_wrap_strategy(self, strategy: WrapStrategy) -> Self
pub fn with_wrap_strategy(self, strategy: WrapStrategy) -> Self
Override the paragraph wrap strategy.
Sourcepub fn with_italic(self, italic: ItalicStyle) -> Self
pub fn with_italic(self, italic: ItalicStyle) -> Self
Override the italic style. Used by callers that build options programmatically (property tests, CLI overrides).
Sourcepub fn with_strong(self, strong: StrongStyle) -> Self
pub fn with_strong(self, strong: StrongStyle) -> Self
Override the strong style.
Sourcepub fn with_list_marker(self, list_marker: ListMarkerStyle) -> Self
pub fn with_list_marker(self, list_marker: ListMarkerStyle) -> Self
Override the unordered-list bullet style.
Sourcepub fn with_list_continuation_indent(
self,
indent: ListContinuationIndent,
) -> Self
pub fn with_list_continuation_indent( self, indent: ListContinuationIndent, ) -> Self
Override list continuation indentation for wrapped list items.
Sourcepub fn with_ordered_list(self, ordered_list: OrderedListStyle) -> Self
pub fn with_ordered_list(self, ordered_list: OrderedListStyle) -> Self
Override the ordered-list numbering policy.
Sourcepub fn with_table(self, table: TableStyle) -> Self
pub fn with_table(self, table: TableStyle) -> Self
Override the GFM table canonicalisation policy.
Sourcepub fn with_thematic_break(self, thematic_break: ThematicStyle) -> Self
pub fn with_thematic_break(self, thematic_break: ThematicStyle) -> Self
Override the thematic-break canonicalisation policy.
Sourcepub fn with_link_def_style(self, link_def_style: LinkDefStyle) -> Self
pub fn with_link_def_style(self, link_def_style: LinkDefStyle) -> Self
Override the link-destination style.
Sourcepub fn resolve_list_marker(&self, source_marker: u8) -> u8
pub fn resolve_list_marker(&self, source_marker: u8) -> u8
Resolve the unordered-list bullet to emit, given the byte the
source used (b'-', b'*', or b'+').
Sourcepub fn with_trailing_newline(self, trailing_newline: TrailingNewline) -> Self
pub fn with_trailing_newline(self, trailing_newline: TrailingNewline) -> Self
Override the trailing-newline policy.
Sourcepub fn with_end_of_line(self, end_of_line: EndOfLine) -> Self
pub fn with_end_of_line(self, end_of_line: EndOfLine) -> Self
Override the end-of-line policy.
Sourcepub fn with_exclude_globs(self, exclude_globs: Vec<String>) -> Self
pub fn with_exclude_globs(self, exclude_globs: Vec<String>) -> Self
Override formatter exclude globs.
Sourcepub fn with_link_def_placement(self, placement: Placement) -> Self
pub fn with_link_def_placement(self, placement: Placement) -> Self
Override reference-definition placement.
Sourcepub fn with_footnote_placement(self, placement: Placement) -> Self
pub fn with_footnote_placement(self, placement: Placement) -> Self
Override footnote-definition placement.
Sourcepub fn with_preserve_frontmatter(self, preserve_frontmatter: bool) -> Self
pub fn with_preserve_frontmatter(self, preserve_frontmatter: bool) -> Self
Override frontmatter preservation.
Source§impl FmtOptions
impl FmtOptions
Sourcepub fn mdformat() -> Self
pub fn mdformat() -> Self
mdformat-compatible formatting profile where mdwright can reproduce mdformat’s spelling without weakening verification.
mdformat 1.0 defaults to wrap = keep; callers that want a
column limit should still set Self::with_wrap explicitly.
Trait Implementations§
Source§impl Clone for FmtOptions
impl Clone for FmtOptions
Source§fn clone(&self) -> FmtOptions
fn clone(&self) -> FmtOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more