问题
I have a public github repository. Following instructions at readthedocs, I used Sphinx to get the documentation in a form I'm happy for others to see.
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.
I've pushed all of that to my public repository at github. In particular, I have a docs.py
and an index.rst
file sitting within docs
, which is a folder sitting in the top level of my project.
I've created my account at readthedocs. I've told readthedocs where to find the repository. I now expect that
Within a few seconds your code will automatically be fetched from your public repository, and the documentation will be built.
Instead, readthedocs appears to build it, but when I go to look at it, there's just nothing there. The webpage exists, but it doesn't have any of the documentation present. The same file built on my computer shows the documentation.
You can see the output from the build at readthedocs here.
One more detail that may be relevant is that I had to edit the conf.py
file at github so that it knows that the main code is in the directory that docs
sits in.
So - what do I need to change to get readthedocs to correctly build my documentation, and more importantly, what have I misunderstood?
回答1:
RTD cannot find a module that is imported by your module. See the error by expanding the fourth item: https://readthedocs.org/projects/epidemicsonnetworks/builds/5247491/
So whatever you do locally to build the docs cannot be done on RTD until you configure RTD to find the module. There is an FAQ that covers this issue.
For Pyramid, we have a setup.py, and put the command -e .[docs]
into a file called rtd.txt
, both at the root level of the project. Then we configure RTD to use this file, under Advanced Settings:
- tick "Install your project inside a virtualenv using
setup.py install
" - enter the name of your Requirements file.
See screenshot.
来源:https://stackoverflow.com/questions/43217198/readthedocs-not-creating-documentation-from-public-github-repository