mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Infer titles of pages based on full Markdown parsing (#3191)
Properly parse Markdown and report the first H1 tag rather than naively looking for `# Stuff` at the start of the doc. This satisfies feature requests such as supporting setext-style headers and fixes attr-list suffixes that failed to be ignored. Co-authored-by: Hendrik Polczynski <hendrikpolczyn@gmail.com> Co-authored-by: Darrick Herwehe <darrick@exitcodeone.com>
This commit is contained in:
@@ -380,10 +380,14 @@ specific page. The following keys are supported:
|
||||
MkDocs will attempt to determine the title of a document in the following
|
||||
ways, in order:
|
||||
|
||||
1. A title defined in the [nav] configuration setting for a document.
|
||||
2. A title defined in the `title` meta-data key of a document.
|
||||
3. A level 1 Markdown header on the first line of the document body. Please note that [Setext-style] headers are not supported.
|
||||
4. The filename of a document.
|
||||
1. A title defined in the [nav] configuration setting for a document.
|
||||
|
||||
2. A title defined in the `title` meta-data key of a document.
|
||||
|
||||
3. A level 1 Markdown header on the first line of the document body.
|
||||
([Setext-style] headers are supported *only since MkDocs 1.5*.)
|
||||
|
||||
4. The filename of a document.
|
||||
|
||||
Upon finding a title for a page, MkDoc does not continue checking any
|
||||
additional sources in the above list.
|
||||
|
||||
Reference in New Issue
Block a user