小编dww*_*dww的帖子

如何添加目录树条目?

我正在尝试开始使用 Sphinx 来记录 Python,但我似乎缺少一些非常基本的入门步骤。

我正在关注http://www.sphinx-doc.org/en/stable/tutorial.html并已安装和配置(尽可能使用默认值)该工具。

问题是我无法将另一个 RST 文件链接到 index.js 文件。我的索引文件如下:

Welcome to FirstProject's documentation!
====================================
.. toctree::
   :maxdepth: 2

intro
Run Code Online (Sandbox Code Playgroud)

请注意 intro.rst 与以下内容位于同一目录中:

Introduction to the FirstProject project!!
======================================

.. toctree::
    :maxdepth: 2
Run Code Online (Sandbox Code Playgroud)

输出类型为 html。当我尝试

make html
Run Code Online (Sandbox Code Playgroud)

我收到一条警告说:

/home/ngk/Code/Projects/Twitter/botscore/doc/intro.rst: WARNING: document isn't included in any toctree
Run Code Online (Sandbox Code Playgroud)

我希望在 index.html 中创建一个带有“intro”字符串的超链接,链接指向 intro.html

相反,在 index.html 文件的预期位置只有一个字符串“intro”。请注意,已创建 intro.html 文件,但未从 index.html 超链接

有人可以建议我错过了看似很小的一步吗?

python restructuredtext python-sphinx toctree

5
推荐指数
1
解决办法
3143
查看次数

标签 统计

python ×1

python-sphinx ×1

restructuredtext ×1

toctree ×1