--- /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 19B27431FDE\r
+ for <notmuch@notmuchmail.org>; Sat, 12 Jul 2014 20:11:51 -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 G367pZd3dUa0 for <notmuch@notmuchmail.org>;\r
+ Sat, 12 Jul 2014 20:11:43 -0700 (PDT)\r
+Received: from qmta07.emeryville.ca.mail.comcast.net\r
+ (qmta07.emeryville.ca.mail.comcast.net [76.96.30.64])\r
+ by olra.theworths.org (Postfix) with ESMTP id CFC55431FC2\r
+ for <notmuch@notmuchmail.org>; Sat, 12 Jul 2014 20:11:29 -0700 (PDT)\r
+Received: from omta07.emeryville.ca.mail.comcast.net ([76.96.30.59])\r
+ by qmta07.emeryville.ca.mail.comcast.net with comcast\r
+ id Rf1Z1o0011GXsucA7fBV76; Sun, 13 Jul 2014 03:11:29 +0000\r
+Received: from odin.tremily.us ([24.18.63.50])\r
+ by omta07.emeryville.ca.mail.comcast.net with comcast\r
+ id RfBU1o00K152l3L8UfBUzj; Sun, 13 Jul 2014 03:11:29 +0000\r
+Received: from mjolnir.tremily.us (unknown [192.168.0.150])\r
+ by odin.tremily.us (Postfix) with ESMTPS id 4EC051286F09;\r
+ Sat, 12 Jul 2014 20:11:28 -0700 (PDT)\r
+Received: (nullmailer pid 31456 invoked by uid 1000);\r
+ Sun, 13 Jul 2014 03:10:44 -0000\r
+From: "W. Trevor King" <wking@tremily.us>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 5/5] doc: Add rst2html support for building HTML docs\r
+Date: Sat, 12 Jul 2014 20:10:37 -0700\r
+Message-Id:\r
+ <1a5837370d77c3d24b94b6fbc087c26084e59d3d.1405220724.git.wking@tremily.us>\r
+X-Mailer: git-send-email 1.9.1.353.gc66d89d\r
+In-Reply-To: <cover.1405220724.git.wking@tremily.us>\r
+References: <cover.1405220724.git.wking@tremily.us>\r
+In-Reply-To: <cover.1405220724.git.wking@tremily.us>\r
+References: <cover.1405220724.git.wking@tremily.us>\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
+ s=q20140121; t=1405221089;\r
+ bh=VYTc0KoXqboExTgAKfTOKJlXAH54eABoUJ6B336o5jU=;\r
+ h=Received:Received:Received:Received:From:To:Subject:Date:\r
+ Message-Id;\r
+ b=n/l47x1cUgm2KFrVTWPLdEjn2GPUwQnfJbjkW9Smi0UqO0+EocaTaHGrbN8ga1F/W\r
+ d5A1zTn38DXYO/Tv0X5w5d9hx4aeau0yYhy8xtWAcaoGvYqbM2nwIIiweqyO6iEOAC\r
+ ddJI0gpcMV1LpuZbovOu8JP5kmGRjvf7hLD1RHMfYFExl4nQIzXMLyCPrY01N63825\r
+ 5cCO40EHpadvC+8DVybEY+CtM0DIrGp0gjJ1wuWeO9Nzi0zJ3ci2mZTitGSIDxzqVB\r
+ IrbIGeAl0sP8ncJeDjBVWI80/UZ0TEnYip3dGNuMOXe4blsVFnybRKxKeHIKv/PSds\r
+ hO72vmvfMzOlg==\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: Sun, 13 Jul 2014 03:11:51 -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 | 25 ++++++++++++++++++++++++-\r
+ doc/INSTALL | 7 +++++--\r
+ doc/Makefile.local | 2 ++\r
+ 3 files changed, 31 insertions(+), 3 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index 20a2d5f..446439f 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
+@@ -431,6 +433,20 @@ else\r
+ have_rst2man=0\r
+ printf "No (so will not install man pages).\n"\r
+ fi\r
++\r
++ printf "Checking if rst2html is available... "\r
++ for RST2HTML in rst2html rst2html.py; do\r
++ if "${RST2HTML}" -V > /dev/null 2>&1; then\r
++ have_rst2html=1\r
++ printf "Yes (${RST2HTML}).\n"\r
++ break\r
++ fi\r
++ RST2HTML=\r
++ done\r
++ if [ -z "${RST2HTML}" ]; then\r
++ have_rst2html=0\r
++ printf "No (so can not build HTML docs).\n"\r
++ fi\r
+ fi\r
+ \r
+ libdir_in_ldconfig=0\r
+@@ -830,6 +846,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 9b99c19..e0a6963 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
++ $(rstman2any) --converter "$(RST2HTML)" --input $(srcdir)/doc --output $(DOCBUILDDIR)/html --extension html\r
+ else\r
+ @echo "fatal: no Sphinx, cannot build HTML docs"\r
+ @false\r
+-- \r
+1.9.1.353.gc66d89d\r
+\r