跳过reStructuredText中的标题级别 [英] Skipping heading levels in reStructuredText

查看:218
本文介绍了跳过reStructuredText中的标题级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过某种方式跳过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:

不需要使用所有节标题样式,也不需要任何特定的样式 节标题样式将被使用.但是,文档必须在以下方面保持一致 它使用的部分标题:一旦标题样式的层次结构是 建立后,各部分必须使用该层次结构.

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时,会发出警告:

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中的标题级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆