--- /dev/null
+Return-Path: <wking@tremily.us>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 5FB37431FBF\r
+ for <notmuch@notmuchmail.org>; Sat, 10 May 2014 10:04:33 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id ts7ItTnDu0OY for <notmuch@notmuchmail.org>;\r
+ Sat, 10 May 2014 10:04:26 -0700 (PDT)\r
+Received: from qmta04.westchester.pa.mail.comcast.net\r
+ (qmta04.westchester.pa.mail.comcast.net [76.96.62.40])\r
+ by olra.theworths.org (Postfix) with ESMTP id 10585431FC2\r
+ for <notmuch@notmuchmail.org>; Sat, 10 May 2014 10:04:20 -0700 (PDT)\r
+Received: from omta04.westchester.pa.mail.comcast.net ([76.96.62.35])\r
+ by qmta04.westchester.pa.mail.comcast.net with comcast\r
+ id 0Gvg1o0030ldTLk54H4K6M; Sat, 10 May 2014 17:04:19 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+ by omta04.westchester.pa.mail.comcast.net with comcast\r
+ id 0H4J1o00X152l3L01H4KWf; Sat, 10 May 2014 17:04:19 +0000\r
+Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
+ by odin.tremily.us (Postfix) with ESMTPS id 3B71F11969AD;\r
+ Sat, 10 May 2014 10:04:18 -0700 (PDT)\r
+Received: (nullmailer pid 24537 invoked by uid 1000);\r
+ Sat, 10 May 2014 17:03:44 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 5/5] doc: Add rst2html support for building HTML docs\r
+Date: Sat, 10 May 2014 10:03:36 -0700\r
+Message-Id:\r
+ <5f852b5f1b0f84bb513d209b9ac1b731f2ec7fa8.1399740604.git.wking@tremily.us>\r
+X-Mailer: git-send-email 1.9.1.353.gc66d89d\r
+In-Reply-To: <cover.1399740604.git.wking@tremily.us>\r
+References: <cover.1399740604.git.wking@tremily.us>\r
+In-Reply-To: <cover.1399740604.git.wking@tremily.us>\r
+References: <cover.1399740604.git.wking@tremily.us>\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+ s=q20140121; t=1399741459;\r
+ bh=Gu36dE00/vied5NwRm3GgfkIjh9aF/4shKQ+Kr2TpYs=;\r
+ h=Received:Received:Received:Received:From:To:Subject:Date:\r
+ Message-Id;\r
+ b=wqwgmRNTGck7hnz5fimndg2Bk5uv86SNEtB5QzzniJUr7g9AtCYzJJ5BckDmpOLXr\r
+ Yk/wZEySlbQUc9KA1GmVxRlVZf3g8TzmUL5JKEdyPY9AaJhKDxDoiKH4ahRw62t5fN\r
+ AY8+gqACiOp4YJoRkDDX4nd+z+zh5qXZDc+pkeHR+xHMxwxELEU1UAVhH4VuIeBDhj\r
+ f0BG8+D5LBk8IMJL7sJBgBilCXr32GEI98m8klZqdHqDakEb/Cw1U2fq0+4GXCrsDg\r
+ tyKsdqLCouYZZwNSj85/XOfl5PrfbpmJTzZbXDPgbYfo5Fs7ZvtMd8tP4cHRzXFpCL\r
+ Obl1rcaw+qi1A==\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 10 May 2014 17:04:33 -0000\r
+\r
+We already fall back to rst2man if Sphinx isn't available for building\r
+the man pages. With this commit we'll fall back to rst2html for\r
+building the HTML docs too. The only tricky bit here is that\r
+HAVE_SPHINX explicitly checks for sphinx.writers.manpage. I'm just\r
+assuming sphinx.writers.html exists, to avoid adding a separate\r
+SPHINX_HTML variable. However, the HTML builder is Sphinx's default,\r
+so it's hard to imagine it not being installed :p. Perhaps it would\r
+be better to drop the HAVE_* settings and SPHINXBUILD to use:\r
+\r
+* SPHINX2MAN empty for not-available, otherwise path to script that\r
+ can handle '-b manpage'\r
+* SPHINX2HTML empty for not-available, otherwise path to script that\r
+ can handle '-b html'\r
+* RST2MAN empty for not-available, otherwise path to script\r
+* RST2HTML empty for not-available, otherwise path to script\r
+\r
+I'm sticking with the less intrusive change for now, but I'm happy\r
+with either approach.\r
+---\r
+ configure | 26 +++++++++++++++++++++++++-\r
+ doc/INSTALL | 7 +++++--\r
+ doc/Makefile.local | 2 ++\r
+ 3 files changed, 32 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index f017af8..8fb3d19 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -414,8 +414,10 @@ if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev\r
+ have_sphinx=1\r
+ have_rst2man=0\r
+ RST2MAN=\r
++ have_rst2html=0\r
++ RST2HTML=\r
+ else\r
+- printf "No (falling back to rst2man).\n"\r
++ printf "No (falling back to Docutils).\n"\r
+ have_sphinx=0\r
+ \r
+ printf "Checking if rst2man is available... "\r
+@@ -432,6 +434,21 @@ else\r
+ RST2MAN=\r
+ printf "No (so will not install man pages).\n"\r
+ fi\r
++\r
++ printf "Checking if rst2html is available... "\r
++ if rst2html -V > /dev/null 2>&1; then\r
++ have_rst2html=1\r
++ RST2HTML=$(command -v rst2html)\r
++ printf "Yes (${RST2HTML}).\n"\r
++ elif rst2man.py -V > /dev/null 2>&1; then\r
++ have_rst2html=1\r
++ RST2HTML=$(command -v rst2html.py)\r
++ printf "Yes (${RST2HTML}).\n"\r
++ else\r
++ have_rst2html=0\r
++ RST2HTML=\r
++ printf "No (so can not build HTML docs).\n"\r
++ fi\r
+ fi\r
+ \r
+ libdir_in_ldconfig=0\r
+@@ -831,6 +848,13 @@ HAVE_RST2MAN=${have_rst2man}\r
+ # an empty string if no such program is available.\r
+ RST2MAN=${RST2MAN}\r
+ \r
++# Whether there's a rst2html binary available for building documentation\r
++HAVE_RST2HTML=${have_rst2html}\r
++\r
++# The path to the rst2html program for building documentation. Set to\r
++# an empty string if no such program is available.\r
++RST2HTML=${RST2HTML}\r
++\r
+ # The directory to which desktop files should be installed\r
+ desktop_dir = \$(prefix)/share/applications\r
+ \r
+diff --git a/doc/INSTALL b/doc/INSTALL\r
+index 8352f7b..bd00dcf 100644\r
+--- a/doc/INSTALL\r
++++ b/doc/INSTALL\r
+@@ -20,8 +20,8 @@ Building with Docutils\r
+ \r
+ If you don't have Sphinx installed, you can use Docutils_ with the\r
+ same targets outlined above for Sphinx. The Docutils converters\r
+-(rst2man, rst2html, etc.) are used instead of Sphinx. Only the man\r
+-targets are currently supported.\r
++(rst2man, rst2html, etc.) are used instead of Sphinx. Only the HTML\r
++and man targets are currently supported.\r
+ \r
+ Configuring the builder\r
+ -----------------------\r
+@@ -36,5 +36,8 @@ your ``PATH`` and sets an appropriate ``RST2MAN`` in\r
+ ``Makefile.config``. If neither ``HAVE_SPHINX`` nor ``HAVE_RST2MAN``\r
+ is 1, attempting to build the documentation will fail with an error.\r
+ \r
++A parallel set of variables (``HAVE_RST2HTML`` and ``RST2HTML``) is\r
++used when building HTML docs with Docutills.\r
++\r
+ .. _Sphinx: http://sphinx-doc.org/\r
+ .. _Docutils: http://docutils.sourceforge.net/\r
+diff --git a/doc/Makefile.local b/doc/Makefile.local\r
+index 49aa6dd..d78844a 100644\r
+--- a/doc/Makefile.local\r
++++ b/doc/Makefile.local\r
+@@ -23,6 +23,8 @@ ALLSPHINXOPTS := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)\r
+ build-html:\r
+ ifeq ($(HAVE_SPHINX),1)\r
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCBUILDDIR)/html\r
++else ifeq ($(HAVE_RST2HTML),1)\r
++ $(prerst2x) "$(RST2HTML)" $(srcdir)/doc $(DOCBUILDDIR)/html html\r
+ else\r
+ @echo "fatal: no Sphinx, cannot build HTML docs"\r
+ @false\r
+-- \r
+1.9.1.353.gc66d89d\r
+\r