pub struct MDBOOK007 { /* private fields */ }Expand description
MDBOOK007: Validate include file paths and existence
This rule validates that all include directives in markdown files point to existing files with correct syntax. It prevents build failures and broken includes by checking:
The rule:
- Finds all include directive patterns in markdown content
- Resolves include paths relative to the source file
- Validates target files exist and are readable
- Checks line range syntax and bounds where applicable
- Verifies anchor references exist in target files
- Detects circular include dependencies
- Provides clear error messages for debugging
Include Directive Formats Supported:
- Basic file includes:
{{#include file.txt}} - Line ranges:
{{#include file.rs:10:20}} - Named anchors:
{{#include file.rs:anchor_name}} - Relative paths:
{{#include ../other/file.md}} - Rust-specific:
{{#rustdoc_include file.rs}}
Trait Implementations§
Source§impl AstRule for MDBOOK007
impl AstRule for MDBOOK007
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 MDBOOK007
impl RefUnwindSafe for MDBOOK007
impl Send for MDBOOK007
impl Sync for MDBOOK007
impl Unpin for MDBOOK007
impl UnwindSafe for MDBOOK007
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)