Update MD001/heading-increment to support front matter title as the first heading of the page.

This commit is contained in:
Alexandre Feblot 2025-06-07 04:54:23 +02:00 committed by GitHub
parent a366f80873
commit 1b6839bff0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 317 additions and 16 deletions

View file

@ -26,6 +26,15 @@ level at a time:
### Another Heading 3
```
If [YAML](https://en.wikipedia.org/wiki/YAML) front matter is present and
contains a `title` property (commonly used with blog posts), this rule treats
that as a top level heading and will report a violation if the actual first
heading is not a level 2 heading. To use a different property name in the
front matter, specify the text of a regular expression via the
`front_matter_title` parameter. To disable the use of front matter by this
rule, specify `""` for `front_matter_title`. When front matter is not present,
the first heading can be any level.
Rationale: Headings represent the structure of a document and can be confusing
when skipped - especially for accessibility scenarios. More information:
<https://www.w3.org/WAI/tutorials/page-structure/headings/>.