sphinx
sphinx copied to clipboard
✨ Add `sphinx.ext.apidoc` extension
A common use case, is that users want to simply point sphinx towards a Python module, and have it generate documentation automatically. (see e.g. https://github.com/rtfd/readthedocs.org/issues/1139)
This is not possible currently,
without a "pre-build" step of running the sphinx-apidoc
CLI.
(and in fact there are numerous examples of users calling sphinx-apidoc
within their conf.py
to work around this)
This PR adds sphinx.ext.apidoc
as a sphinx extension, to incorporate the source file generation into the sphinx build in a "formal" manner, using the API rather than the CLI.
related to #6829 (but does not close it)
This PR is currently in draft, since there are a number of TODOs in the code, and documentation needs to be added.