[ACCEPTED]-Automatically build Sphinx documentation when a source file changes-python-sphinx
You can use sphinx-autobuild.
It is easy to use, for example:
sphinx-autobuild docs docs/_build/html
or, if 3 you have a separate build dir,
sphinx-autobuild source build/html
It will also 2 automatically initiate a page refresh in 1 the browser.
Jacob Kaplan-Moss has a good solution:
pip install watchdog
watchmedo shell-command \
--patterns="*.rst" \
--ignore-pattern='_build/*' \
--recursive \
--command='make html'
Note, change the pattern 2 to match your suffix. Jacob uses *.txt, but 1 I needed to change it to *.rst.
If you're on a *nix system, you can use 4 inotify to monitor filesystem events and 3 trigger actions.
For example, on ubuntu,
apt-get install inotify-tools
Then 2 run a script like this to listen for events 1 in a given dir
while true
do
inotifywait -r -e modify -e move -e create -e delete /tmp/docs | while read line
do
echo "file changed; time to run make html"
done
done
You can create a macro in you favorite editor 2 that saves the file and opens it in your 1 browser, any text editor can do (geany, gedit, emacs, vi, notepad++...)
More Related questions
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.