equ*_*ghe 5 restructuredtext heading python-sphinx
是否有可能以某种方式跳过 RestructuredText 中的标题级别?例如,给定
####
PART
####
*******
Chapter
*******
Section
=======
Subsection
----------
Subsubsection
^^^^^^^^^^^^
Paragraph
"""""""""
Another section
===============
Another Paragraph
"""""""""""""""""
The above heading seems to be rendered as a subsection-level heading...
Run Code Online (Sandbox Code Playgroud)
最后一段被呈现为一个小节而不是一个段落。(我使用Sphinx作为渲染器。)所以看起来部分级别的检测是本地的,尽管RestructuredText 文档说它应该是一致的:
不需要使用所有节标题样式,也不需要使用任何特定的节标题样式。但是,文档在使用节标题时必须保持一致:一旦建立了标题样式的层次结构,节就必须使用该层次结构。
在问题中的文档上运行 Sphinx 1.3 时,会发出警告:
C:\path\to\test.rst:24: SEVERE: Title level inconsistent:
Run Code Online (Sandbox Code Playgroud)
“Another Paragraph”位于第 24 行,它被渲染为小节标题,因为这是 Sphinx 在该位置所期望的。
所以不,你不能跳过标题级别。这也是我如何解释问题中引用的关于一致性的段落的含义。
| 归档时间: |
|
| 查看次数: |
1573 次 |
| 最近记录: |