Expand description
Core linting engine for mdbook-lint
This library provides markdown linting functionality with mdBook support. It includes both standard markdown rules (MD001-MD059) and mdBook-specific rules (MDBOOK001-007).
§Basic Usage
use mdbook_lint_core::{create_engine_with_all_rules, Document};
use std::path::PathBuf;
let engine = create_engine_with_all_rules();
let document = Document::new("# Hello".to_string(), PathBuf::from("test.md"))?;
let violations = engine.lint_document(&document)?;
§Custom Rule Sets
use mdbook_lint_core::{PluginRegistry, StandardRuleProvider, MdBookRuleProvider};
let mut registry = PluginRegistry::new();
registry.register_provider(Box::new(StandardRuleProvider))?;
registry.register_provider(Box::new(MdBookRuleProvider))?;
let engine = registry.create_engine()?;
Re-exports§
pub use config::Config;
pub use document::Document;
pub use engine::LintEngine;
pub use engine::PluginRegistry;
pub use engine::RuleProvider;
pub use error::ConfigError;
pub use error::DocumentError;
pub use error::ErrorContext;
pub use error::IntoMdBookLintError;
pub use error::MdBookLintError;
pub use error::MdlntError;
pub use error::PluginError;
pub use error::Result;
pub use error::RuleError;
pub use registry::RuleRegistry;
pub use rule::AstRule;
pub use rule::Rule;
pub use rule::RuleCategory;
pub use rule::RuleMetadata;
pub use rule::RuleStability;
pub use violation::Severity;
pub use violation::Violation;
pub use rules::MdBookRuleProvider;
pub use standard_provider::StandardRuleProvider;
Modules§
- config
- Core configuration types for mdbook-lint-core
- 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
- registry
- rule
- rules
- Consolidated rules module for mdbook-lint
- standard_
provider - Standard markdown rules (MD001-MD059).
- violation
- Violation types for mdbook-lint
Constants§
- DESCRIPTION
- Description
- NAME
- Human-readable name
- VERSION
- Current version of mdbook-lint-core
Functions§
- create_
engine_ with_ all_ rules - Create a lint engine with all available rules (standard + mdBook)
- create_
mdbook_ engine - Create a lint engine with only mdBook-specific rules
- create_
standard_ engine - Create a lint engine with only standard markdown rules