Friday, January 30, 2015

Automatic build and reload for Sphinx documentation

I'm beginning to use Sphinx to create a document and I got sick of compiling and reloading every time I wanted to see what was going on. So I learned how to get it to automatically compile to html and then reload Firefox. The solution is below.

#pip install watchdog
#sudo apt-get install xvkbd
#!/bin/bash
watchmedo shell-command \
--patterns="*.rst" \
--ignore-pattern='_build/*' \
--recursive \
--command='make html && xvkbd -window Firefox -text "\Cr"'
view raw gistfile1.sh hosted with ❤ by GitHub

It's a combination of two useful tidbits.

One introduces Watchdog:
http://jacobian.org/writing/auto-building-sphinx/

The other introduces xvkbd:
http://stackoverflow.com/a/15589391/456878

No comments:

Post a Comment