Skip to main content

ReflowOptions

Struct ReflowOptions 

Source
pub struct ReflowOptions {
Show 14 fields 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>>, pub atomic_spans: bool, pub length_exemptions: LengthExemptions,
}
Expand description

Options for reflowing text

Fields§

§line_length: usize

Target line length

§break_on_sentences: bool

Whether to break on sentence boundaries when possible

§preserve_breaks: bool

Whether to preserve existing line breaks in paragraphs

§sentence_per_line: bool

Whether to enforce one sentence per line

§semantic_line_breaks: bool

Whether 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: ReflowLengthMode

How to measure string length for line-length comparisons

§attr_lists: bool

Whether to treat {#id .class key=“value”} as atomic (unsplittable) elements. Enabled for MkDocs and Kramdown flavors.

§myst_roles: bool

Whether 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: bool

Whether 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.

§atomic_spans: bool

Whether to hold emphasis/strong/strikethrough and code spans atomic during reflow. When true (default), these spans are treated as atomic units. When false, they can be wrapped word-by-word like normal text.

§length_exemptions: LengthExemptions

Which of the checker’s line-length exemptions reflow mirrors when it measures a line. Empty measures the markdown as written.

Trait Implementations§

Source§

impl Clone for ReflowOptions

Source§

fn clone(&self) -> ReflowOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ReflowOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more