Struct MDBOOK025

Source
pub struct MDBOOK025;
Expand description

Rule that allows multiple H1 headings in SUMMARY.md files

In mdBook projects, SUMMARY.md files legitimately use multiple H1 headings to organize content into parts and sections. This rule overrides the standard MD025 behavior specifically for SUMMARY.md files.

Implementations§

Source§

impl MDBOOK025

Source

pub fn new() -> Self

Create a new MDBOOK025 rule

Trait Implementations§

Source§

impl AstRule for MDBOOK025

Source§

fn id(&self) -> &'static str

Unique identifier for the rule (e.g., “MD001”)
Source§

fn name(&self) -> &'static str

Human-readable name for the rule (e.g., “heading-increment”)
Source§

fn description(&self) -> &'static str

Description of what the rule checks
Source§

fn metadata(&self) -> RuleMetadata

Metadata about this rule’s status and properties
Source§

fn check_ast<'a>( &self, document: &Document, _ast: &'a AstNode<'a>, ) -> Result<Vec<Violation>>

Check a document using its AST
Source§

fn can_fix(&self) -> bool

Whether this rule can automatically fix violations
Source§

fn fix(&self, _content: &str, _violation: &Violation) -> Option<String>

Attempt to fix a violation (if supported)
Source§

fn create_violation( &self, message: String, line: usize, column: usize, severity: Severity, ) -> Violation

Create a violation for this rule
Source§

impl Default for MDBOOK025

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Rule for T
where T: AstRule,

Source§

fn id(&self) -> &'static str

Unique identifier for the rule (e.g., “MD001”)
Source§

fn name(&self) -> &'static str

Human-readable name for the rule (e.g., “heading-increment”)
Source§

fn description(&self) -> &'static str

Description of what the rule checks
Source§

fn metadata(&self) -> RuleMetadata

Metadata about this rule’s status and properties
Source§

fn check_with_ast<'a>( &self, document: &Document, ast: Option<&'a Node<'a, RefCell<Ast>>>, ) -> Result<Vec<Violation>, MdBookLintError>

Check a document for violations of this rule with optional pre-parsed AST
Source§

fn check(&self, document: &Document) -> Result<Vec<Violation>, MdBookLintError>

Check a document for violations of this rule (backward compatibility)
Source§

fn can_fix(&self) -> bool

Whether this rule can automatically fix violations
Source§

fn fix(&self, content: &str, violation: &Violation) -> Option<String>

Attempt to fix a violation (if supported)
Source§

fn create_violation( &self, message: String, line: usize, column: usize, severity: Severity, ) -> Violation

Create a violation for this rule
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.