{"id":519,"date":"2014-06-22T22:48:24","date_gmt":"2014-06-23T04:48:24","guid":{"rendered":"http:\/\/www.crccheck.com\/blog\/?p=519"},"modified":"2015-10-11T22:22:17","modified_gmt":"2015-10-12T04:22:17","slug":"autobuilding-sphinx-docs","status":"publish","type":"post","link":"https:\/\/www.crccheck.com\/blog\/autobuilding-sphinx-docs\/","title":{"rendered":"Autobuilding Sphinx Docs With inotify"},"content":{"rendered":"<p>So tonight I decided I&#8217;ve been putting it off far enough, and started my first Sphinx documentation project. Read The Docs&#8217;s <a href=\"http:\/\/read-the-docs.readthedocs.org\/en\/latest\/getting_started.html\" target=\"_blank\">Getting Started<\/a> guide wasn&#8217;t bad, but it really bothered me that there wasn&#8217;t a good way to autobuild the docs.<\/p>\n<p>I ended up just adding this to the makefile:<\/p>\n<pre><code># If you don't have inotify-tools, install it first: `apt-get install inotify-tools`\r\nwatch:\r\n    @while true; do \\\r\n    inotifywait --recursive -e modify -e move -e create -e delete \\\r\n    --exclude $(BUILDDIR) . &amp;&amp; $(MAKE) --silent html; done\r\n<\/code><\/pre>\n<p><a href=\"http:\/\/jacobian.org\/writing\/auto-building-sphinx\/\" target=\"_blank\">This blog post<\/a> by JKM is often cited as a way to do it too, but the <code>install_requires<\/code> section of watchdog&#8217;s setup.py was longer than I felt like sitting through.<\/p>\n<p>There&#8217;s a promising project, <a href=\"https:\/\/pypi.python.org\/pypi\/sphinx-autobuild\/\" target=\"_blank\">sphinx-autobuild<\/a>, but the readme currently says &#8220;sphinx-autobuild relies on a not-yet-released version of python-livereload&#8221; and it also uses watchdog; so forget that. If I end up spending a lot of time writing docs, it&#8217;s worth getting this up and running though because it comes with LiveReload.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So tonight I decided I&#8217;ve been putting it off far enough, and started my first Sphinx documentation project. Read The Docs&#8217;s Getting Started guide wasn&#8217;t bad, but it really bothered me that there wasn&#8217;t a good way to autobuild the docs.<\/p>\n <a href=\"https:\/\/www.crccheck.com\/blog\/autobuilding-sphinx-docs\/\" title=\"Autobuilding Sphinx Docs With inotify\" class=\"entry-more-link\"><span>Read More<\/span> <span class=\"screen-reader-text\">Autobuilding Sphinx Docs With inotify<\/span><\/a>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[47,4],"tags":[54,48],"class_list":["entry","author-showmewhatyougot","has-excerpt","post-519","post","type-post","status-publish","format-standard","category-meh-practices","category-technical","tag-makefiles","tag-python"],"_links":{"self":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts\/519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/comments?post=519"}],"version-history":[{"count":4,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts\/519\/revisions"}],"predecessor-version":[{"id":537,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/posts\/519\/revisions\/537"}],"wp:attachment":[{"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/media?parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/categories?post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.crccheck.com\/blog\/wp-json\/wp\/v2\/tags?post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}