Update documentation for MD003/heading-style to call out an additional scenario (fixes #644).

This commit is contained in:
David Anson 2022-12-08 22:30:17 -08:00
parent a86998bf6f
commit fc98a7c59d
3 changed files with 51 additions and 24 deletions

View file

@ -1,5 +1,5 @@
This rule is triggered when different heading styles (atx, setext, and 'closed' This rule is triggered when different heading styles are used in the same
atx) are used in the same document: document:
```markdown ```markdown
# ATX style H1 # ATX style H1
@ -10,7 +10,7 @@ Setext style H1
=============== ===============
``` ```
Be consistent with the style of heading used in a document: To fix the issue, use consistent heading styles throughout the document:
```markdown ```markdown
# ATX style H1 # ATX style H1
@ -18,8 +18,9 @@ Be consistent with the style of heading used in a document:
## ATX style H2 ## ATX style H2
``` ```
The setext_with_atx and setext_with_atx_closed doc styles allow atx-style The `setext_with_atx` and `setext_with_atx_closed` settings allow ATX-style
headings of level 3 or more in documents with setext style headings: headings of level 3 or more in documents with setext-style headings (which only
support level 1 and 2 headings):
```markdown ```markdown
Setext style H1 Setext style H1
@ -31,8 +32,16 @@ Setext style H2
### ATX style H3 ### ATX style H3
``` ```
Note: the configured heading style can be a specific style to use (atx, Note: The configured heading style can be a specific style to require (`atx`,
atx_closed, setext, setext_with_atx, setext_with_atx_closed), or simply require `atx_closed`, `setext`, `setext_with_atx`, `setext_with_atx_closed`), or may
that the usage is consistent within the document. just require that usage is consistent within the document via `consistent`.
Note: The placement of a horizontal rule directly below a line of text can
trigger this rule by turning that text into a level 2 setext-style heading:
```markdown
A line of text followed by a horizontal rule becomes a heading
---
```
Rationale: Consistent formatting makes it easier to understand a document. Rationale: Consistent formatting makes it easier to understand a document.

View file

@ -99,8 +99,8 @@ Parameters:
`atx_closed` / `consistent` / `setext` / `setext_with_atx` / `atx_closed` / `consistent` / `setext` / `setext_with_atx` /
`setext_with_atx_closed`) `setext_with_atx_closed`)
This rule is triggered when different heading styles (atx, setext, and 'closed' This rule is triggered when different heading styles are used in the same
atx) are used in the same document: document:
```markdown ```markdown
# ATX style H1 # ATX style H1
@ -111,7 +111,7 @@ Setext style H1
=============== ===============
``` ```
Be consistent with the style of heading used in a document: To fix the issue, use consistent heading styles throughout the document:
```markdown ```markdown
# ATX style H1 # ATX style H1
@ -119,8 +119,9 @@ Be consistent with the style of heading used in a document:
## ATX style H2 ## ATX style H2
``` ```
The setext_with_atx and setext_with_atx_closed doc styles allow atx-style The `setext_with_atx` and `setext_with_atx_closed` settings allow ATX-style
headings of level 3 or more in documents with setext style headings: headings of level 3 or more in documents with setext-style headings (which only
support level 1 and 2 headings):
```markdown ```markdown
Setext style H1 Setext style H1
@ -132,9 +133,17 @@ Setext style H2
### ATX style H3 ### ATX style H3
``` ```
Note: the configured heading style can be a specific style to use (atx, Note: The configured heading style can be a specific style to require (`atx`,
atx_closed, setext, setext_with_atx, setext_with_atx_closed), or simply require `atx_closed`, `setext`, `setext_with_atx`, `setext_with_atx_closed`), or may
that the usage is consistent within the document. just require that usage is consistent within the document via `consistent`.
Note: The placement of a horizontal rule directly below a line of text can
trigger this rule by turning that text into a level 2 setext-style heading:
```markdown
A line of text followed by a horizontal rule becomes a heading
---
```
Rationale: Consistent formatting makes it easier to understand a document. Rationale: Consistent formatting makes it easier to understand a document.

View file

@ -10,8 +10,8 @@ Parameters:
`atx_closed` / `consistent` / `setext` / `setext_with_atx` / `atx_closed` / `consistent` / `setext` / `setext_with_atx` /
`setext_with_atx_closed`) `setext_with_atx_closed`)
This rule is triggered when different heading styles (atx, setext, and 'closed' This rule is triggered when different heading styles are used in the same
atx) are used in the same document: document:
```markdown ```markdown
# ATX style H1 # ATX style H1
@ -22,7 +22,7 @@ Setext style H1
=============== ===============
``` ```
Be consistent with the style of heading used in a document: To fix the issue, use consistent heading styles throughout the document:
```markdown ```markdown
# ATX style H1 # ATX style H1
@ -30,8 +30,9 @@ Be consistent with the style of heading used in a document:
## ATX style H2 ## ATX style H2
``` ```
The setext_with_atx and setext_with_atx_closed doc styles allow atx-style The `setext_with_atx` and `setext_with_atx_closed` settings allow ATX-style
headings of level 3 or more in documents with setext style headings: headings of level 3 or more in documents with setext-style headings (which only
support level 1 and 2 headings):
```markdown ```markdown
Setext style H1 Setext style H1
@ -43,8 +44,16 @@ Setext style H2
### ATX style H3 ### ATX style H3
``` ```
Note: the configured heading style can be a specific style to use (atx, Note: The configured heading style can be a specific style to require (`atx`,
atx_closed, setext, setext_with_atx, setext_with_atx_closed), or simply require `atx_closed`, `setext`, `setext_with_atx`, `setext_with_atx_closed`), or may
that the usage is consistent within the document. just require that usage is consistent within the document via `consistent`.
Note: The placement of a horizontal rule directly below a line of text can
trigger this rule by turning that text into a level 2 setext-style heading:
```markdown
A line of text followed by a horizontal rule becomes a heading
---
```
Rationale: Consistent formatting makes it easier to understand a document. Rationale: Consistent formatting makes it easier to understand a document.