MDS004: first-line-heading
First line of the file should be a heading.
# Settings
| Setting | Type | Default | Description |
|---|---|---|---|
level | int | 1 | Required heading level for the first line |
placeholders | list | [] | Placeholder tokens to treat as opaque; see placeholder grammar |
Useful tokens: heading-question, var-token, placeholder-section.
# Config
Enable (default):
rules:
first-line-heading:
level: 1Disable:
rules:
first-line-heading: falseCustom (require level 2):
rules:
first-line-heading:
level: 2# Examples
# Bad — content before heading
Some content here.
# Title# Bad — blank line before heading
The file below has a blank line between the frontmatter closing
--- and # Title. The blank line is not visible in the code
block but triggers the diagnostic.
# Title# Good
# Title
Some content here.# Diagnostics
| Message | Condition |
|---|---|
first line should be a level {level} heading | Line 1 is missing or not a heading |
first line should be a level {level} heading, found blank line | First child is a heading but preceded by blank line |
first heading should be level {level}, got {n} | First heading on line 1 has the wrong level |