问题描述
是否可以通过某种方式跳过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...
最后一段呈现为小节而不是段落. (我正在使用 Sphinx 作为渲染器.)因此,尽管 RestructuredText文档说应该保持一致:
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:
推荐答案
在问题文档中运行Sphinx 1.3时,会发出警告:
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:
另一段"位于第24行,它被渲染为小节标题,因为这是Sphinx期望的那个位置.
"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.
这篇关于跳过reStructuredText中的标题级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!