This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for RTD auto-generated docs
I realized I had never actually tested the work around listed here: readthedocs/readthedocs.org#1139 I'm going to try that and see how it goes...
- Loading branch information
1 parent
de976a3
commit 481b85e
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Documentation setup | ||
|
||
## Dependencies | ||
Sphinx documentation generation is done via Make. You will need sphinx and sphinx_rtd_theme installed: | ||
pip install sphinx sphinx_rtd_theme | ||
|
||
## Build Process | ||
make html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
481b85e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, did that work? :-)
481b85e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The short answer is: kind of.
This change alone wasn't enough, but it put me on the right path to finding a working solution. The following is a (hopefully helpful) recap of what I ended up doing:
I found that several projects have defined an "ext" module that they import in the sphinx conf.py file. For example, after implementing the "ext" module, my folder structure looks like:
and the extensions list looks like (the two important imports being
sphinx.ext.autodoc
andext.apidoc
):For this to work, you have to add the modules to the module path, which is actually explained in comments just above the "General Configuration" section of an auto-generated sphinx conf.py file. In my case I've added paths to the two modules I'm testing, as well as the path to the "ext" module that actually executes autodoc:
The contents of
.../docs/ext/apidoc.py
work very similarly to the changes I made in this commit. There's a great example in the openstack deb-python-pycadf repo, which I've tweaked to fit my particular situation. My version just takes into account the two packages I'm testing, and excludes 'setup.py' and 'tests' which were causing a bunch of apidoc errors.I hope this was helpful for you, and possibly others in the future. If you have any questions, let me know. :)