pub struct MDBOOK006 { /* private fields */ }Expand description
MDBOOK006: Validate internal cross-reference links between chapters
This rule validates that internal links with anchor fragments point to valid headings
in the target files. It focuses specifically on cross-reference validation between
chapters, ensuring that [text](file.md#heading) links work correctly.
The rule:
- Only processes internal links with anchor fragments (e.g.,
file.md#section) - Resolves target files relative to the current document
- Parses target files to extract heading anchors
- Validates that the anchor fragment exists in the target file
- Supports configurable anchor ID generation strategies
- Caches parsed files to improve performance on large books
Anchor ID Generation:
- Converts heading text to lowercase
- Replaces spaces and non-alphanumeric characters with hyphens
- Removes leading/trailing hyphens and consecutive hyphens
- Handles Unicode characters appropriately
Trait Implementations§
Source§impl AstRule for MDBOOK006
impl AstRule for MDBOOK006
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Description of what the rule checks
Source§fn metadata(&self) -> RuleMetadata
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>>
fn check_ast<'a>( &self, document: &Document, ast: &'a AstNode<'a>, ) -> Result<Vec<Violation>>
Check a document using its AST
Auto Trait Implementations§
impl Freeze for MDBOOK006
impl RefUnwindSafe for MDBOOK006
impl Send for MDBOOK006
impl Sync for MDBOOK006
impl Unpin for MDBOOK006
impl UnwindSafe for MDBOOK006
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
Mutably borrows from an owned value. Read more
Source§impl<T> Rule for Twhere
T: AstRule,
impl<T> Rule for Twhere
T: AstRule,
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Description of what the rule checks
Source§fn metadata(&self) -> RuleMetadata
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>
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>
fn check(&self, document: &Document) -> Result<Vec<Violation>, MdBookLintError>
Check a document for violations of this rule (backward compatibility)