TOC树问题

Sim*_*mon 1 python-sphinx

我刚刚使用Sphinx创建了我的文档,这是我的问题:最初在Toc树指令中是空的,然后我在下面添加"教程",它看起来像这样:

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

当我"制作HTML"时,我没有在索引页面上获得"教程".然后我在与index.rst相同的dircetory中创建了一个tutorial.rst.我再次"制作html"并收到此错误消息:"toctree包含对不存在的文档的引用".

我该如何解决 ?谢谢.

小智 5

也许试试这个:

.. toctree::
   :maxdepth: 2

   tutorial <tutorial>

..
Run Code Online (Sandbox Code Playgroud)

假设您的tutorial.rst文件位于index.rst文件的同一级别的"source"目录中

编辑以下注释:换行在toctree选项和页面列表之间很重要