Struct MDBOOK005

Source
pub struct MDBOOK005 { /* private fields */ }
Expand description

MDBOOK005: Detect orphaned markdown files not referenced in SUMMARY.md

This rule checks for markdown files in the project that are not referenced in SUMMARY.md. Such files are “orphaned” and won’t be included in the generated book, which may indicate:

  • Incomplete documentation structure
  • Forgotten content that should be added to the book
  • Old files that should be removed

The rule:

  • Only runs on SUMMARY.md files
  • Parses all chapter references in SUMMARY.md
  • Scans for .md and .markdown files in the project directory
  • Reports files that exist but aren’t referenced
  • Ignores common files like README.md by default
  • Supports configuration for custom ignore patterns

Implementations§

Source§

impl MDBOOK005

Source

pub fn with_ignored_files(additional_ignored: Vec<String>) -> Self

Create a new instance with custom ignored files (in addition to defaults)

Source

pub fn ignore_file(&mut self, filename: &str)

Add a file to the ignore list

Trait Implementations§

Source§

impl Default for MDBOOK005

Source§

fn default() -> Self

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

impl Rule for MDBOOK005

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 AstNode<'a>>, ) -> Result<Vec<Violation>>

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

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

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

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