【发布时间】:2019-03-09 04:58:18
【问题描述】:
我的索引文件是这样设置的:
Doc Title
==============================
..toctree::
:maxdepth: 3
:numbered:
:caption: Contents
01_file1
01.3_file2
如果内容是这样的话……
01_file1.txt:
Level 1 section title
--------------------------------------------
Level 2 section title
............................................
Another Level 2 section title
............................................
对于 01.3_file2.txt:
A third Level 2 section title
............................................
我会这样认为,因为 Sphinx 将所有内容都视为一个文档:
1. Level 1 section title
1.1 Level 2 section title
1.2 Another Level 2 section title
1.3 A third Level 2 section title
但是我得到了这个:
1. Level 1 section title
1.1 Level 2 section title
1.2 Another Level 2 section title
2. A third Level 2 section title
我猜这是因为 Sphinx(或者可能是 reST/Markdown?)使用每个新文本文件重新启动隐式标题级别。有没有办法得到我真正想要的东西?
引用reST documentation...
不是强加固定数量和顺序的部分标题装饰样式,而是强制执行的顺序将是遇到的顺序。遇到的第一个样式是最外层的标题(如 HTML H1),第二个样式是副标题,第三个是副标题,以此类推。
【问题讨论】:
标签: python-sphinx restructuredtext sections toctree