-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sphinx apidoc extension #4101
Sphinx apidoc extension #4101
Conversation
7fc0b68
to
df371a6
Compare
@shimizukawa could you check this please? |
df371a6
to
b662f7b
Compare
39386c2
to
b7a305a
Compare
We have some cases where this capability would be useful. The output is different enough from autosummary that I don't think we would want to switch over to using that, but we would like to avoid the need to call sphinx-autodoc separately in our pipeline. |
To expand on this,
I took some time today to compare these. There are a number of differences I see here:
Personally, I think these are very different and it's not really fair to compare them. We could extend
If you ask me, this is going to be far more difficult to use and result in far more code than the design I have currently proposed. As noted above though, I'd love to get some input here. |
This is failing because of #4771. We need to resolve that before we can progress here. |
This is an alternative approach to sphinx-doc#1135. Rather than modifying the 'build_sphinx' setuptools extension, we allow 'sphinx-apidoc' to be run as an extension. This is very similar to what we do with 'sphinx-autogen', which can be run automatically using the 'autosummary_generate' configuration option instead. We may wish to remove the 'sphinx-apidoc' binary in the future, but that's a decision for another day. Signed-off-by: Stephen Finucane <stephen@that.guru>
b7a305a
to
782ef62
Compare
Codecov Report
@@ Coverage Diff @@
## master #4101 +/- ##
==========================================
+ Coverage 82.13% 82.16% +0.02%
==========================================
Files 283 289 +6
Lines 37671 38034 +363
Branches 5838 5898 +60
==========================================
+ Hits 30942 31250 +308
- Misses 5418 5463 +45
- Partials 1311 1321 +10
Continue to review full report at Codecov.
|
This is mostly based on the extension submitted as a pull request for Sphinx [1]. [1] sphinx-doc/sphinx#4101 Signed-off-by: Stephen Finucane <stephen@that.guru>
FWIW lots of people try to do something similar. ( readthedocs/readthedocs.org#1139 ) Am sure they would also appreciate proper support in Sphinx for this use case. :) |
Agreed. Do note that the the version needs some rework but the idea is sound. I'm keeping this open until I can get some buy in from the maintainers (or at least told it's never going to happen). I essentially need to drag in the learning from https://github.com/sphinx-contrib/apidoc (the first version wasn't perfect, heh) |
I've spun this into a separate plugin so I'm going to drop this for now. We can pick it up again if a good reason to place this in core pops up. |
Subject: Make 'sphinx-apidoc' an extension
Feature or Bugfix
Purpose
This is an alternative approach to Exntend setuptools command to include sphinx-apidoc #1135. Rather than modifying the 'build_sphinx' setuptools extension, we allow 'sphinx-apidoc' to be run as an extension.
This is very similar to what we do with 'sphinx-autogen', which can be run automatically using the
autosummary_generate
configuration option instead.Not all configuration options are exposed - I wanted some insight into which of these I should expose before doing so.
My eventual goal would be to remove both the
sphinx-apidoc
andsphinx-autogen
binaries at some point, but that's a Sphinx 2.0+ target. I will open an RFE issue to do this.There are no specific environment requirements for this change. Tests are included.
Detail
Relates