Rules Reference
mdbook-lint provides comprehensive markdown linting with two rule categories.
Standard Markdown Rules
59 rules (MD001-MD059) based on the widely-used markdownlint specification. These rules ensure consistent markdown formatting and style.
Categories
- Heading Rules - Heading hierarchy and formatting
- List Rules - List formatting and consistency
- Whitespace Rules - Trailing spaces, blank lines
- Link Rules - URL formatting and link text
- Code Rules - Code block formatting and fencing
- Style Rules - Emphasis and formatting consistency
mdBook-Specific Rules
Rules specifically designed for mdBook projects, validating mdBook-specific syntax and conventions.
Rules
- MDBOOK001 - Code blocks should have language tags
- MDBOOK002 - SUMMARY.md structure validation
- MDBOOK003 - Internal link validation
- MDBOOK004 - Part title formatting
- MDBOOK005 - Chapter path validation
- MDBOOK006 - Draft chapter validation
- MDBOOK007 - Separator syntax validation
Quick Reference
Rules with Automatic Fix Support
The following rules can automatically fix violations:
- MD009 - Remove trailing spaces
- MD010 - Replace hard tabs with spaces
- MD012 - Remove multiple consecutive blank lines
- MD018 - Add space after hash in ATX headings
- MD019 - Fix multiple spaces after hash
- MD020 - Remove spaces inside closed ATX headings
- MD021 - Fix multiple spaces inside closed ATX headings
- MD023 - Remove indentation from headings
- MD027 - Fix multiple spaces after blockquote symbol
- MD030 - Fix spaces after list markers
- MD034 - Wrap bare URLs in angle brackets
- MD047 - Ensure files end with single newline
Disabling Rules
Rules can be disabled globally or for specific files:
# Disable globally
[rules]
MD002 = false
MD041 = false
# Disable for specific files
[ignore]
MD013 = ["CHANGELOG.md", "docs/api/*.md"]