sphinx-doc / sphinx

The Sphinx documentation generator
https://www.sphinx-doc.org/
Other
6.6k stars 2.12k forks source link

Exposing more than just `sphinx-build` to `python -m sphinx` #11656

Closed jamesbraza closed 1 year ago

jamesbraza commented 1 year ago

Is your feature request related to a problem? Please describe.

Running python -m sphinx --help, I see it's an alias for sphinx-build.

It would be cool if this was an entrypoint to other commands, like sphinx-apidoc.

Describe the solution you'd like

A more generalized console entrypoint that supports other commands:

python -m sphinx --help
# Tells about build, apidoc, etc.
python -m sphinx build ...
python -m sphinx apidoc ...

Describe alternatives you've considered

A workaround is directly invoking the relevant modules as listed here:

python -m sphinx.cmd.build ...
python -m sphinx.ext.apidoc ...
AA-Turner commented 1 year ago

See #5618, #6938; #10877 -- this is absolutely a goal, but mainly stuck on not having enough time. I did add -m sphinx build in 7.2 as preparation for this, though.

A

jamesbraza commented 1 year ago

I was sure this had been already requested, but my searching didn't yield any duplicate issues. Thanks for linking them! And your work with Sphinx is appreciated!

Feel free to close this out as a duplicate if desired 👌.