-
Notifications
You must be signed in to change notification settings - Fork 7
Figure out how to best call Sphinx from Python #1
Comments
Yeh, for all the good things about Sphinx, documentation for using its API is not one!
I would definitely say that Related to this, |
Nice - I am learning a little bit about |
(as an aside click is so much more intuitive than argparse, omg) |
Exactly, its just a lot more Object-Orientated, and thus modular. Definitely look at how I have structured it in |
This should be importable -- but doesn't seem documented. I don't think many call |
I'm working on this and should push a prototype to this repo soon! |
OK, just merged #2 which gives us a working CLI! I will try and sharpen this up but it'd be great if others took a look at the general scope of what it's doing to see if this makes sense at all. Once we are OK with the structure we can write some tests and docs. It's focusing on HTML outputs right now, but should be easy to add Latex/PDF outputs. |
ok thanks @choldgraf will take a look. |
this now works - still improvements to be made I'm sure, but I think good enough to close this issue |
Most people interact with Sphinx via the command line (in particular,
sphinx-build
). We'll want to interact with it from within Python as a part of the controller process.It looks like the Sphinx building / initializing step is here:
https://github.com/sphinx-doc/sphinx/blob/3.x/sphinx/cmd/build.py#L269
However, there is some logic in there that we should investigate. In particular, there are some context managers that seem to be patching docutils before calling the
Sphinx
app, and also some parsing of arguments etc. We should make sure those aren't doing something important before just callingSphinx(
Maybe @chrisjsewell has experience with this?
The text was updated successfully, but these errors were encountered: