#[non_exhaustive]pub enum NumberingStyle {
Consecutive,
Top,
}Expand description
The numbering style to be used by the mdbook-numbering preprocessor.
Should be placed under the numbering-style field
in the [preprocessor.numbering] section in book.toml.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Consecutive
There should be no more than one top heading (the heading with the highest level) in the chapter, and it should has the same level as the chapter numbering.
For example, if the numbering of the chapter is 1.2.3, the top heading in the chapter
should be level 3 (i.e., ### Chapter 1.2.3).
This is the default behavior of mdbook-numbering. And it works well with mdbook-pdf
in regard to generating the table of contents.
Top
There should be no more than one top heading (the heading with the highest level)
in the chapter, and it should be level 1 (i.e., # Chapter 1.2.3),
regardless of the chapter numbering.
This style is more flexible, but may lead to inconsistent heading levels across chapters. And using it you may get a flat table of contents when generating PDF with mdbook-pdf.
By the way, this is how the documentation of mdbook is structured.
Implementations§
Trait Implementations§
Source§impl Clone for NumberingStyle
impl Clone for NumberingStyle
Source§fn clone(&self) -> NumberingStyle
fn clone(&self) -> NumberingStyle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NumberingStyle
impl Debug for NumberingStyle
Source§impl Default for NumberingStyle
impl Default for NumberingStyle
Source§impl<'de> Deserialize<'de> for NumberingStyle
impl<'de> Deserialize<'de> for NumberingStyle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for NumberingStyle
impl PartialEq for NumberingStyle
Source§impl Serialize for NumberingStyle
impl Serialize for NumberingStyle
impl Copy for NumberingStyle
impl Eq for NumberingStyle
impl StructuralPartialEq for NumberingStyle
Auto Trait Implementations§
impl Freeze for NumberingStyle
impl RefUnwindSafe for NumberingStyle
impl Send for NumberingStyle
impl Sync for NumberingStyle
impl Unpin for NumberingStyle
impl UnwindSafe for NumberingStyle
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