Rules Reference
mdbook-lint provides comprehensive markdown linting with two categories of rules:
Standard Markdown Rules
59 rules (MD001-MD059) based on the widely-used markdownlint specification. These rules ensure consistent markdown formatting and style across your documentation.
Categories
- Heading Rules - Heading hierarchy, style, and formatting
- List Rules - List formatting, indentation, and consistency
- Whitespace Rules - Trailing spaces, blank lines, tabs
- Link Rules - URL formatting and link text
- Code Rules - Code block formatting and fencing
- Emphasis Rules - Bold and italic formatting
mdBook-Specific Rules
7 rules (MDBOOK001-MDBOOK007) specifically designed for mdBook projects. These rules validate 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"]