Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Support auto-generated API docs #1139
Comments
radix
commented
Feb 1, 2015
|
fwiw I'd also be happy if RTD just allowed me to specify my own build process, so it wouldn't to specifically hardcode support for |
sontek
commented
Feb 10, 2015
|
I'm also trying to use sphinx-apidoc for my documentation. I use a |
jantman
commented
Jun 13, 2015
|
+1 on this... I'm sure, even documenting it in the release procedure, that I'll forget to generate the apidocs and commit them... |
gregmuellegger
added the
Enhancement
label
Jul 10, 2015
|
We are currently developing a new build system. And I assume we could integrate this in there somehow. However it's not there yet, so I assume we won't have a fix for this in the next couple of weeks, but more in the terms of months. |
gregmuellegger
added this to the
rtd-build
milestone
Jul 10, 2015
rtveitch
commented
Aug 7, 2015
|
+1 Adding this support would be incredible and would significantly reduce the friction associated with keeping documentation current. If sphinx-apidoc was supported in readthedocs, a developer wouldn't even need the sphinx toolchain installed locally if they didn't want; their only responsibility would be to keep docstrings up to date. |
matteobachetti
commented
Aug 14, 2015
|
+1 |
posita
commented
Oct 2, 2015
|
|
msarahan
commented
Oct 7, 2015
|
+1 |
onyxfish
referenced this issue
in wireservice/agate
Oct 24, 2015
Closed
The API docs are missing/blank #328
jsmedmar
commented
Nov 20, 2015
|
+1 |
This was referenced Dec 2, 2015
alyjak
commented
Feb 23, 2016
|
FYI, you can work around this by adding something like the following to your project's conf.py file: def run_apidoc(_):
modules = ['a_list_of',
'python_module_directories',
'in_your_project']
for module in modules:
cur_dir = os.path.abspath(os.path.dirname(__file__))
output_path = os.path.join(cur_dir, module, 'doc')
cmd_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # Check to see if we are in a virtualenv
# If we are, assemble the path manually
cmd_path = os.path.abspath(os.path.join(sys.prefix, 'bin', 'sphinx-apidoc'))
subprocess.check_call([cmd_path, '-e', '-o', output_path, module, '--force'])
def setup(app):
app.connect('builder-inited', run_apidoc)This will run sphinx-apidoc during the builder-inited sphinx core event. It should work on readthedocs as well as locally, enabling you to autogenerate your api docs without having to store the output in your git repo. You can even cross reference your manual documentation with these API references. |
fantix
added a commit
to decentfox/aioh2
that referenced
this issue
Mar 8, 2016
|
|
fantix |
1de64f8
|
Maxyme
commented
Apr 29, 2016
•
|
Another solution which doesn't involve directly calling a subprocess is to use the following in conf.py:
instead of
This solved one of the issues I had was with long path names which are restricted on readthedocs. |
bplower
added a commit
to bplower/cssef
that referenced
this issue
May 24, 2016
|
|
bplower |
4e837ac
|
This was referenced Jul 8, 2016
bplower
added a commit
to bplower/cssef
that referenced
this issue
Sep 5, 2016
|
|
bplower |
481b85e
|
iMichka
added a commit
to gccxml/pygccxml
that referenced
this issue
Oct 9, 2016
|
|
iMichka |
e5f7941
|
This was referenced Oct 30, 2016
BowenFu
commented
Nov 10, 2016
|
@alyjak @Maxyme Thanks. And this works for me.
|
This was referenced Nov 15, 2016
TheChymera
commented
Jul 3, 2017
•
|
Thank you! For your code to work, however, you would need to uncomment the def run_apidoc(_):
from sphinx.apidoc import main
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
cur_dir = os.path.abspath(os.path.dirname(__file__))
module = os.path.join(cur_dir,"..","labbookdb")
main(['-e', '-o', cur_dir, module, '--force'])
def setup(app):
app.connect('builder-inited', run_apidoc) |
radix commentedFeb 1, 2015
I use
sphinx-apidocto auto-generate API documentation for my project. Right now I have to commit these auto-generated files to my repository so that RTD can build them into HTML docs. It'd be cool if RTD could run sphinx-apidoc for me, since it's easy to forget to regen API docs and commit them to my repo after making changes to my code.