readthedocs 没有从 public github 存储库创建文档

readthedocs not creating documentation from public github repository

我有一个 public github 存储库。在 readthedocs instructions 之后,我使用 Sphinx 以一种我很乐意让其他人看到的形式获取文档。

Edit your files and rebuild until you like what you see, then commit your changes and push to your public repository. Once you have Sphinx documentation in a public repository, you can start using Read the Docs.

我已将所有这些推送到我位于 github 的 public 存储库。特别是,我在 docs 中有一个 docs.py 和一个 index.rst 文件,这是一个位于我项目顶层的文件夹。

我已经在 readthedocs 创建了我的帐户。我已经告诉 readthedocs 在哪里可以找到存储库。我现在希望

Within a few seconds your code will automatically be fetched from your public repository, and the documentation will be built.

相反,readthedocs 似乎在构建它,但是当我去查看它时,那里什么也没有。该网页存在,但没有任何文档。在我的计算机上构建的相同文件显示了文档。

您可以在 readthedocs here.

查看构建的输出

另一个可能相关的细节是我必须编辑 github 处的 conf.py 文件,以便它知道主要代码位于 docs 所在的目录中英寸

所以 - 我需要更改什么才能让 readthedocs 正确构建我的文档,更重要的是,我误解了什么?

RTD 找不到由您的模块导入的模块。展开第四项看错误:https://readthedocs.org/projects/epidemicsonnetworks/builds/5247491/

因此,除非您配置 RTD 以查找模块,否则您在本地为构建文档所做的任何事情都无法在 RTD 上完成。有一个FAQ that covers this issue.

对于 Pyramid,我们有一个 setup.py,并将命令 -e .[docs] 放入一个名为 rtd.txt 的文件中,两者都在项目的根级别。然后我们配置 RTD 使用这个文件,在 Advanced Settings 下:

  • 打勾"Install your project inside a virtualenv using setup.py install"
  • 输入您的需求文件的名称。

见截图。