2022-10-30 15:13:19 -07:00
|
|
|
# `MD003` - Heading style
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Tags: `headers`, `headings`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
2022-10-30 15:13:19 -07:00
|
|
|
Aliases: `header-style`, `heading-style`
|
2022-10-29 23:21:45 -07:00
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
|
|
* `style`: Heading style (`string`, default `consistent`, values `atx`/`atx_closed`/`consistent`/`setext`/`setext_with_atx`/`setext_with_atx_closed`)
|
|
|
|
|
|
|
|
|
|
This rule is triggered when different heading styles (atx, setext, and 'closed'
|
|
|
|
|
atx) are used in the same document:
|
|
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
|
# ATX style H1
|
|
|
|
|
|
|
|
|
|
## Closed ATX style H2 ##
|
|
|
|
|
|
|
|
|
|
Setext style H1
|
|
|
|
|
===============
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Be consistent with the style of heading used in a document:
|
|
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
|
# ATX style H1
|
|
|
|
|
|
|
|
|
|
## ATX style H2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The setext_with_atx and setext_with_atx_closed doc styles allow atx-style
|
|
|
|
|
headings of level 3 or more in documents with setext style headings:
|
|
|
|
|
|
|
|
|
|
```markdown
|
|
|
|
|
Setext style H1
|
|
|
|
|
===============
|
|
|
|
|
|
|
|
|
|
Setext style H2
|
|
|
|
|
---------------
|
|
|
|
|
|
|
|
|
|
### ATX style H3
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Note: the configured heading style can be a specific style to use (atx,
|
|
|
|
|
atx_closed, setext, setext_with_atx, setext_with_atx_closed), or simply require
|
|
|
|
|
that the usage is consistent within the document.
|
|
|
|
|
|
|
|
|
|
Rationale: Consistent formatting makes it easier to understand a document.
|