Skip to content

improve section headers documentation #11087

Description

@ynikitenko

Describe the bug

In the official Sphinx reStructuredText Primer it is written that

Section headers (ref) are created by underlining (and optionally overlining) the section title with a punctuation character

so it is optional. I understood that it should not affect anything.

However, in RST specification for sections it is stated:

Underline-only adornment styles are distinct from overline-and-underline styles that use the same character.

It says nothing about the hierarchy though, whether underline-only are higher or lower than underline-and-overline and how they are related to headers with other characters. Probably it is solved by this:

Rather than imposing a fixed number and order of section title adornment styles, the order enforced will be the order as encountered.

I think that to have documentation in two places is misleading (or please state explicitly that one should consult the specification). Or maybe the word "optional" is misleading there. I'm having troubles with section hierarchy in LaTeX and this was one of the catches I stumbled upon - I think this could be improved!

How to Reproduce

can be checked with such index.rst

=====
Title

Subtitle 1


Subtitle 2

Environment Information

Sphinx
Version: 5.3.0, 6.0.0 works same.

Sphinx extensions

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions