Md063 - Heading Capitalization¶
Aliases: heading-capitalization
What This Rule Does¶
Enforces consistent capitalization styles for markdown headings. This rule supports title case, sentence case, and all caps styles.
Note: This rule is disabled by default. You must explicitly enable it in your configuration.
Why This Matters¶
- Consistency: Ensures all headings follow the same capitalization style
- Professional appearance: Properly capitalized headings look more polished
- Readability: Consistent formatting helps readers navigate your document
- Style guide compliance: Many style guides require specific heading capitalization
Examples¶
Title Case (default)¶
Incorrect¶
Correct¶
Sentence Case¶
Incorrect¶
Correct¶
All Caps¶
Incorrect¶
Correct¶
Configuration¶
| Option | Type | Default | Description |
|---|---|---|---|
style |
string | "title_case" |
Capitalization style: title_case, sentence_case, or all_caps |
lowercase-words |
string[] | (see below) | Words to keep lowercase in title case |
ignore-words |
string[] | [] |
Words to preserve exactly (brand names) |
preserve-cased-words |
boolean | true |
Auto-preserve words with internal capitals |
min-level |
integer | 1 |
Minimum heading level to check (1-6) |
max-level |
integer | 6 |
Maximum heading level to check (1-6) |
Default Lowercase Words¶
Example Configurations¶
Enable With Title Case (default)¶
Sentence Case¶
All Caps¶
Preserve Brand Names¶
[MD063]
style = "title_case"
ignore-words = ["iPhone", "macOS", "GitHub", "JavaScript", "TypeScript"]
preserve-cased-words = true
Only Check H1 and H2 Headings¶
Custom Lowercase Words¶
[MD063]
style = "title_case"
lowercase-words = ["a", "an", "the", "and", "but", "or", "for", "nor", "on", "at", "to", "by", "from", "with", "without", "into", "onto", "upon", "vs", "via"]
Special Handling¶
Inline Code¶
Inline code spans are preserved as-is:
Becomes:
The backticked content is never modified.
Links¶
Link text is capitalized, but URLs are preserved:
Becomes:
Custom Header IDs¶
Custom header IDs (Kramdown syntax) are preserved:
Becomes:
Mixed-Case Words¶
When preserve-cased-words is enabled (default), words with internal capitals are preserved:
Becomes:
Note: "GitHub" is preserved because it has an internal capital letter.
Hyphenated Words¶
Each part of a hyphenated word is capitalized in title case:
Becomes:
Automatic Fixes¶
This rule can automatically fix capitalization issues. Run:
Related Rules¶
Rationale¶
Consistent heading capitalization improves document readability and professionalism. This rule uses the titlecase crate which implements John Gruber's title case algorithm, ensuring proper handling
of edge cases like articles, prepositions, and hyphenated words.
The rule is disabled by default because capitalization preferences vary widely between style guides (AP, Chicago, APA) and personal preferences. Enable it only if your project requires consistent heading capitalization.