-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add sphinx.ext.apidoc
extension
#13333
Conversation
A common usecase, is that users simply want to point sphinx towards a Python module, and have it generate documentation automatically. This is not possible currently, without a "pre-build" step of running the `sphinx-autogen` CLI. This PR adds `sphinx.ext.apidoc` as a sphinx extension, to incorporate the source file generation into the sphinx build.
A common use-case is that users simply want to point Sphinx towards a Python module, and have it generate documentation automatically. This is not possible currently, without a "pre-build" step of running the `sphinx-autogen` CLI. This PR adds `sphinx.ext.apidoc` as a sphinx extension, to incorporate the source file generation into the sphinx build. Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
Feel free to push to the original PR branch in the future instead of opening a replacement PR, makes it easier to keep all review comments in the same place! |
Would you oppose splitting these out to one configuration option per default value? It's easier for typing and documentation to be more granular, but it is more verbose. This is also the approach taken by /~https://github.com/sphinx-contrib/apidoc. A |
so like yeh err it is a bit verbose, and annoying to code 😅 thinking out loud; would it not be nicer to more generally allow |
I'd posit the opposite view, that using arbitrary dictionaries is a worse experience. It's harder to ensure type safety within Sphinx, and passing (mutable) dicts around is harder to follow than individual keys. I also think the documentation is better for individual options, as we can use A |
Ok @AA-Turner I've changed it to individual options, I still don't really agree, but it's not a hill I want to die on lol
Well there is no real type safety with |
c453288
to
cf75a69
Compare
# Conflicts: # sphinx/ext/apidoc/_shared.py
Thank you! A |
Cheers! |
Awesome that this package got merged into sphinx! Nice job. A couple questions and possible bugs:
|
I honestly didn't even know about exclude patterns should be absolute or relative to the conf directory |
Ok and if I'm seeing the changes in this PR correctly the default was changed to True for remove old, right? Correct me if not. Now to file a bug for sphinx 8.2.0 using much more memory than 8.1.x... |
feel free to propose any documentation updates to clarify anything |
A related wish I've had for years is doing this all in-memory: #1139 (comment). |
Purpose
A common use-case is that users simply want to point Sphinx towards a Python module, and have it generate documentation automatically.
This is not possible currently, without a "pre-build" step of running the
sphinx-autogen
CLI.This PR adds
sphinx.ext.apidoc
as a sphinx extension, to incorporate the source file generation into the sphinx build.https://sphinx--13333.org.readthedocs.build/en/13333/usage/extensions/apidoc.html#module-sphinx.ext.apidoc
References
sphinx.ext.apidoc
as an extension #12471sphinx.ext.apidoc
extension #13220