mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-23 01:10:13 +01:00
33 lines
No EOL
939 B
Markdown
33 lines
No EOL
939 B
Markdown
# MD025 - Multiple top level headers in the same document
|
|
|
|
Tags: headers
|
|
|
|
Aliases: single-h1
|
|
|
|
Parameters: level (number; default 1)
|
|
|
|
This rule is triggered when a top level header is in use (the first line of
|
|
the file is a h1 header), and more than one h1 header is in use in the
|
|
document:
|
|
|
|
# Top level header
|
|
|
|
# Another top level header
|
|
|
|
To fix, structure your document so that there is a single h1 header that is
|
|
the title for the document, and all later headers are h2 or lower level
|
|
headers:
|
|
|
|
# Title
|
|
|
|
## Header
|
|
|
|
## Another header
|
|
|
|
Rationale: A top level header is a h1 on the first line of the file, and
|
|
serves as the title for the document. If this convention is in use, then there
|
|
can not be more than one title for the document, and the entire document
|
|
should be contained within this header.
|
|
|
|
Note: The `level` parameter can be used to change the top level (ex: to h2) in
|
|
cases where an h1 is added externally. |