【发布时间】:2018-05-22 18:48:11
【问题描述】:
我正在尝试开始使用 Sphinx 来记录 Python,但我似乎错过了一些非常基本的入门步骤。
我正在关注http://www.sphinx-doc.org/en/stable/tutorial.html 并已安装并配置(尽可能使用默认值)该工具。
问题是我无法将另一个 RST 文件链接到索引。我的索引文件如下:
Welcome to FirstProject's documentation!
====================================
.. toctree::
:maxdepth: 2
intro
注意intro.rst在同一个目录下,内容如下:
Introduction to the FirstProject project!!
======================================
.. toctree::
:maxdepth: 2
输出类型是html。当我尝试时
make html
我收到一条警告:
/home/ngk/Code/Projects/Twitter/botscore/doc/intro.rst: WARNING: document isn't included in any toctree
我希望在 index.html 中创建一个带有“intro”字符串的超链接,该链接指向 intro.html
相反,在 index.html 文件的预期位置中只有一个字符串“intro”。请注意,intro.html 文件已创建,但不是从 index.html 超链接
有人可以建议我错过了什么看似很小的一步吗?
【问题讨论】:
-
指令
toctree的语法不正确。指令的所有内容都需要缩进,就像指令名称缩进一样。在您的情况下,它是 3 个空格。
标签: python python-sphinx restructuredtext toctree