pub struct ReflowOptions {
pub line_length: usize,
pub break_on_sentences: bool,
pub preserve_breaks: bool,
pub sentence_per_line: bool,
pub semantic_line_breaks: bool,
pub abbreviations: Option<Vec<String>>,
pub length_mode: ReflowLengthMode,
pub attr_lists: bool,
pub myst_roles: bool,
pub require_sentence_capital: bool,
pub max_list_continuation_indent: Option<usize>,
pub defined_references: Option<HashSet<String>>,
}Expand description
Options for reflowing text
Fields§
§line_length: usizeTarget line length
break_on_sentences: boolWhether to break on sentence boundaries when possible
preserve_breaks: boolWhether to preserve existing line breaks in paragraphs
sentence_per_line: boolWhether to enforce one sentence per line
semantic_line_breaks: boolWhether to use semantic line breaks (cascading split strategy)
abbreviations: Option<Vec<String>>Custom abbreviations for sentence detection Periods are optional - both “Dr” and “Dr.” work the same Custom abbreviations are always added to the built-in defaults
length_mode: ReflowLengthModeHow to measure string length for line-length comparisons
attr_lists: boolWhether to treat {#id .class key=“value”} as atomic (unsplittable) elements. Enabled for MkDocs and Kramdown flavors.
myst_roles: boolWhether to treat MyST inline roles ({role}`content`) as atomic
(unsplittable) elements. Enabled for the MyST flavor so the colon inside
{domain:role} is never used as a clause-break point.
require_sentence_capital: boolWhether to require uppercase after periods for sentence detection. When true (default), only “word. Capital” is a sentence boundary. When false, “word. lowercase” is also treated as a sentence boundary. Does not affect ! and ? which are always treated as sentence boundaries.
max_list_continuation_indent: Option<usize>Cap list continuation indent to this value when set. Used by mkdocs flavor where continuation is always 4 spaces regardless of checkbox markers.
defined_references: Option<HashSet<String>>Defined reference labels for the surrounding document, used to decide
whether a bare shortcut reference ([text]) is a real link (kept atomic
during reflow) or literal bracketed prose (wrapped like normal text).
None means no reference information is available: every shortcut is
treated as atomic. This is the safe default - it never splits a real
link, at the cost of also not wrapping literal bracketed prose.
Some(set) enables definition-aware behavior: a shortcut is atomic only
when its normalized label (see normalize_reference_label) is in the
set. Full and collapsed reference links and reference images are always
atomic regardless, because their ][ref] / [] syntax is an explicit
link signal that does not depend on a definition being in scope.
Trait Implementations§
Source§impl Clone for ReflowOptions
impl Clone for ReflowOptions
Source§fn clone(&self) -> ReflowOptions
fn clone(&self) -> ReflowOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ReflowOptions
impl RefUnwindSafe for ReflowOptions
impl Send for ReflowOptions
impl Sync for ReflowOptions
impl Unpin for ReflowOptions
impl UnsafeUnpin for ReflowOptions
impl UnwindSafe for ReflowOptions
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more