Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skipping heading levels in reStructuredText

Is it possible in some way to skip heading levels in RestructuredText? For example, given

####
PART
####

*******
Chapter
*******

Section
=======

Subsection
----------

Subsubsection
^^^^^^^^^^^^

Paragraph
"""""""""

Another section
===============

Another Paragraph
"""""""""""""""""
The above heading seems to be rendered as a subsection-level heading...

The last paragraph gets rendered as a subsection instead of as a paragraph. (I am using Sphinx as a renderer.) So it seems section-level detecting is local, although the RestructuredText documentation says it should be consistent:

All section title styles need not be used, nor need any specific section title style be used. However, a document must be consistent in its use of section titles: once a hierarchy of title styles is established, sections must use that hierarchy.

like image 366
equaeghe Avatar asked Oct 31 '22 17:10

equaeghe


1 Answers

When running Sphinx 1.3 on the document in the question, a warning is emitted:

C:\path\to\test.rst:24: SEVERE: Title level inconsistent:

"Another Paragraph" is on line 24 and it gets rendered as a subsection heading because that is what Sphinx expects at that position.

So no, you cannot skip heading levels. That is also how I interpret the meaning of the passage about consistency quoted in the question.

like image 117
mzjn Avatar answered Nov 18 '22 15:11

mzjn