mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
26 lines
770 B
Markdown
26 lines
770 B
Markdown
![]() |
> Note: *MD002 has been deprecated and is disabled by default.*
|
||
|
> [MD041/first-line-heading](md041.md) offers an improved implementation.
|
||
|
|
||
|
This rule is intended to ensure document headings start at the top level and
|
||
|
is triggered when the first heading in the document isn't an h1 heading:
|
||
|
|
||
|
```markdown
|
||
|
## This isn't an H1 heading
|
||
|
|
||
|
### Another heading
|
||
|
```
|
||
|
|
||
|
The first heading in the document should be an h1 heading:
|
||
|
|
||
|
```markdown
|
||
|
# Start with an H1 heading
|
||
|
|
||
|
## Then use an H2 for subsections
|
||
|
```
|
||
|
|
||
|
Note: The `level` parameter can be used to change the top-level (ex: to h2) in
|
||
|
cases where an h1 is added externally.
|
||
|
|
||
|
Rationale: The top-level heading often acts as the title of a document. More
|
||
|
information: <https://cirosantilli.com/markdown-style-guide#top-level-header>.
|