Expand description
mdbook-lint CLI and preprocessor
This crate provides the command-line interface and mdBook preprocessor functionality for mdbook-lint. It builds on the mdbook-lint-core library to provide CLI tools and mdBook integration.
§Basic Usage
use mdbook_lint::{Document, PluginRegistry};
use mdbook_lint_rulesets::{StandardRuleProvider, MdBookRuleProvider};
use std::path::PathBuf;
let mut registry = PluginRegistry::new();
registry.register_provider(Box::new(StandardRuleProvider)).unwrap();
registry.register_provider(Box::new(MdBookRuleProvider)).unwrap();
let engine = registry.create_engine().unwrap();
let document = Document::new("# Hello".to_string(), PathBuf::from("test.md"))?;
let violations = engine.lint_document(&document)?;
Re-exports§
pub use config::Config;
pub use preprocessor::MdBookLint;
Modules§
- cli_
prelude - Common imports for CLI usage
- config
- deduplication
- Rule deduplication logic to eliminate duplicate violations
- document
- engine
- Rule provider system and lint engine.
- error
- Error types for mdbook-lint
- prelude
- Common imports
- preprocessor
- registry
- rule
- test_
helpers - Test helper utilities for rule testing
- violation
- Violation types for mdbook-lint
Structs§
- Document
- Represents a parsed markdown document with position information
- Lint
Engine - Markdown linting engine
- Plugin
Registry - Registry for managing rule providers and creating engines
- Rule
Metadata - Metadata about a rule’s status, category, and properties
- Rule
Registry - Registry for managing linting rules
- Violation
- A violation found during linting
Enums§
- Config
Error - Specialized error type for configuration operations
- Document
Error - Specialized error type for document-related operations
- MdBook
Lint Error - Main error type for mdbook-lint operations
- Plugin
Error - Specialized error type for plugin operations
- Rule
Category - Rule categories for grouping and filtering
- Rule
Error - Specialized error type for rule-related operations
- Rule
Stability - Rule stability levels
- Severity
- Severity levels for violations
Constants§
- CLI_
DESCRIPTION - Description for CLI
- CLI_
NAME - Human-readable name for CLI
- CLI_
VERSION - Current version of mdbook-lint CLI
- DESCRIPTION
- Description
- NAME
- Human-readable name
- VERSION
- Current version of mdbook-lint-core
Traits§
- AstRule
- Helper trait for AST-based rules
- Error
Context - Error context extension trait for adding contextual information to errors
- Into
MdBook Lint Error - Extension trait for converting specialized errors to MdBookLintError
- Rule
- Trait that all linting rules must implement
- Rule
Provider - Trait for rule providers to register rules with the engine
Functions§
- create_
engine_ with_ all_ rules - Create a lint engine with all available rules (standard + mdBook) Note: Requires mdbook-lint-rulesets dependency for rule providers
- create_
mdbook_ engine - Create a lint engine with only mdBook-specific rules Note: Requires mdbook-lint-rulesets dependency for rule providers
- create_
standard_ engine - Create a lint engine with only standard markdown rules Note: Requires mdbook-lint-rulesets dependency for rule providers
Type Aliases§
- Mdlnt
Error - Compatibility alias for the old error name
- Result
- Result type alias for mdbook-lint operations