sphinx-doc / sphinx-autobuild

Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a hot-reload web server.
MIT License
523 stars 75 forks source link

Add a new --exec_script flag to run pre-build command #70

Closed HarisGodil closed 3 years ago

HarisGodil commented 5 years ago

Now sphinx-autobuild has the ability to run a script before building.

If the script errors out, sphinx-autobuild will print out a warning, but otherwise continue.

My use case for this feature: In my previous workflow of manually rebuilding, I had a script that would automatically add in an automodule directive in the test documentation. If someone changes what a test script references, I want the automodule directives to also update.

For #69

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.07%) to 76.0% when pulling dc599e0435cad30d40ca19eca4b41483f1519934 on HarisGodil:exec_script into e0f40b6359ca00a48ca5ba903de1e25da27de453 on GaretJax:develop.

pradyunsg commented 3 years ago

Oooo! Interesting! I'll take a bit of time to come around to reviewing this -- just got the commit bit recently #81 -- but this looks like a really good thing to add. :)