python - 狮身人面像:modules.rst:警告:文档不包含在任何目录树中
问题描述
尝试使用 Sphinx 生成文档。
首先使用:sphinx-apidoc
然后使用:sphinx-build html
我收到了有关该modules.rst
文件的警告。文件存在,html也生成了,看起来肯定是目录。
我阅读了我能找到的关于该主题的所有主题,没有一个能解决问题(index.rst
使用指令在文件中正确定位模块 delation .. include::
...)
我不知道该怎么做才能让它工作
这是我的index.rst
文件的副本,也许你会看到我没有看到的东西。生成的 rst 文件位于sources
文件夹中
Welcome to documentation!
=====================================
.. toctree::
:maxdepth: 4
:caption: Contents:
modules
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
我也收到此消息:
..\doc\sphinx\index.rst:4: WARNING: toctree contains reference to nonexisting document u'modules'
如果我用另一个文档替换模块,我会得到以下信息:
\doc\sphinx\index.rst:4: WARNING: toctree contains reference to nonexisting document u'opsimtest'
looking for now-outdated files... none found
pickling environment... done
checking consistency... \doc\sphinx\_apidocs\modules.rst: WARNING: document isn't included in any toctree
所以看起来即使我在 toctree 中命名了另一个文档,它仍在寻找 modules.rst (并且没有看到另一个文档,但是它被构建到一个 html 文件中)
在本主题中:Can't get sphinx to link under toctree to another document the error message states intro.rst
instead of modules.rst
. 编辑:正如我所说,不幸的是我已经阅读了其他线程并且他们没有解决我的问题。它还是坏了。
解决方案
在 reST 中,空白是有意义的。指令及其选项必须用空行与其内容隔开。
.. toctree::
:maxdepth: 4
:caption: Contents:
_apidocs/modules
推荐阅读
- android - 在doingbackground中发布进度,在android中给出意想不到的值
- css - Antd 将 Tooltip 应用于非折叠 Sider 上的 Menu.Item
- python - 使用熊猫重新排列数据框
- angular - 带有 Angular 应用程序的 Freshdesk 反馈小部件
- reactjs - 如何从 ReactJS 组件调用 Laravel Api 路由?
- java - 绝对 uri: http://www.springframework.org/tags/form 无法在 web.xml 或随此应用程序部署的 jar 文件中解析
- python - 当执行许多与返回 id 结合时,Psycopg2 返回 none
- java - 什么是类
输入安卓? - python - 导入lib_元数据。使用 cx-Freeze 创建的可执行文件出错
- asp.net - 在 ReactJS 中使用 API 时无法从数据库中获取数据