问题
My repo is located on github here: https://github.com/AshleySetter/optoanalysis
And the docs are in https://github.com/AshleySetter/optoanalysis/tree/master/optoanalysis/docs
ReadTheDocs doesn't fail but the produced documentation (hosted here: https://optoanalysis.readthedocs.io/en/latest/) doesn't display the doc strings that should be produced by the ..autodoc::
command.
However it runs fine locally and displays the documentation when I open the build/html/index.html file.
On ReadTheDocs it looks like:
Whereas the locally built html file looks like so:
Why might this be?
回答1:
You have modules written in Cython and compiled to C. I think ReadTheDocs doesn't support C extensions. You have to protect you imports to be generated at ReadTheDocs.
Something like this:
import os
if 'READTHEDOCS' not in os.environ:
import cython_generated_ext
来源:https://stackoverflow.com/questions/44989408/autodoc-directive-works-locally-but-not-on-readthedocs