Skip to content

Incorrect Headline Hierarchy in Rust Book #20826

Closed
@killercup

Description

@killercup

In the markdown files, a number sub-chapter headlines seem to be first level ones (single #), resulting in h1s in the output. The chapter title is rendered as a h1 as well. This is semantically wrong—the content contains subheadings to the chapter.

An example is the chapter The Rust Testing Guide. It should be noted that some chapters do use second level headlines, e.g. Compound Data Types.

Since the chapter heading is not inserted as a regular headline but as special title attribute (%), it is debatable what is the correct content headline level is.

Two possible ways to fix this:

  • Change all files to contain at most second level headlines
  • Change rustbook to increment headline levels by one

cc @steveklabnik

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions