我正在使用狮身人面像(托管在https://readthedocs.org上)生成HTML和PDF格式的文档。 HTML可以正常工作。 PDF也可以成功构建,但是存在嵌套问题:我希望从目录中链接的每个顶级.rst
文档都作为顶级“章节”包含在PDF中。但是,它们实际上是作为小节包含的,从属于首页index.rst
的内容。这是我的index.rst
中的内容:
====
Blah
====
Welcome to the Blah project. It does various things.
Quickstart
==========
To download and install the Python package:
-------------------------------------------
* `python -m pip install Blah`
To run the demo:
----------------
* `python -m Blah --demo`
.. NEED SOME DIRECTIVE HERE
to tell sphinx/latex that Installation, BasicUsage
and friends are NOT subsections of "To run the demo"
but rather chapters at the same level as "Quickstart".
.. toctree::
:caption: Table of Contents
:maxdepth: 2
Installation
BasicUsage
AdvancedUsage
License
Indices and Tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
...此屏幕截图显示了我从PDF中获得的内容:
...我想将“如何安装Blah”作为第2章,将“基本用法”作为第3章,依此类推。 (HTML看起来井井有条:将登录页面分为三个部分,分别为Quickstart,<< Contents>,<< Indices and Tables>。)]]我的search-foo未能使我在创建PDF的过程中告诉狮身人面像的任何方法,“在这里上升了两个层次”或“在这里结束了本章”(请参见上面的index.rst
列表)。这实际上可行吗? 章节文件之一Installation.rst
的内容如下:
How to Install Blah
===================
It's on pypi.org so just use `pip`.
其他文件BasicUsage.rst
,AdvancedUsage.rst
和License.rst
既可以出于示例目的而从目录中删除,也可以采用相同的方式构造:带有=
下划线标题的单线(下划线与上面的“快速入门”相同)。
我正在使用托管在https://readthedocs.org上的sphinx,以生成HTML和PDF格式的文档。 HTML可以正常工作。 PDF也可以成功构建,但是存在嵌套问题:I ...
latex_documents
的conf.py
参数中为乳胶模式配置一个不同的索引文件。)