gpt4 book ai didi

python-sphinx - 在 reStructuredText 中跳过标题级别

转载 作者:行者123 更新时间:2023-12-04 05:49:09 25 4
gpt4 key购买 nike

是否有可能以某种方式跳过 RestructuredText 中的标题级别?例如,给定

####
PART
####

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

Section
=======

Subsection
----------

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

Paragraph
"""""""""

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

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

最后一段被呈现为一个小节而不是一个段落。 (我使用 Sphinx 作为渲染器。)所以看起来节级检测是本地的,尽管 RestructuredText documentation说它应该是一致的:

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.

最佳答案

在问题中的文档上运行 Sphinx 1.3 时,会发出警告:

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

“另一段”在第 24 行,它被呈现为小节标题,因为这是 Sphinx 在该位置所期望的。

所以不,你不能跳过标题级别。这也是我如何解释问题中引用的关于一致性的段落的含义。

关于python-sphinx - 在 reStructuredText 中跳过标题级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33149169/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com