Re: [PATCH 3/5] nmbug-status: Add an nmbug-status(5) man page
[notmuch-archives.git] / 8c / 5d7745857c269e6a35bbcc31830c089abb8ee2
1 Return-Path: <wking@tremily.us>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 5FB37431FBF\r
6         for <notmuch@notmuchmail.org>; Sat, 10 May 2014 10:04:33 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: 0\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
13         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001]\r
14         autolearn=disabled\r
15 Received: from olra.theworths.org ([127.0.0.1])\r
16         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
17         with ESMTP id ts7ItTnDu0OY for <notmuch@notmuchmail.org>;\r
18         Sat, 10 May 2014 10:04:26 -0700 (PDT)\r
19 Received: from qmta04.westchester.pa.mail.comcast.net\r
20         (qmta04.westchester.pa.mail.comcast.net [76.96.62.40])\r
21         by olra.theworths.org (Postfix) with ESMTP id 10585431FC2\r
22         for <notmuch@notmuchmail.org>; Sat, 10 May 2014 10:04:20 -0700 (PDT)\r
23 Received: from omta04.westchester.pa.mail.comcast.net ([76.96.62.35])\r
24         by qmta04.westchester.pa.mail.comcast.net with comcast\r
25         id 0Gvg1o0030ldTLk54H4K6M; Sat, 10 May 2014 17:04:19 +0000\r
26 Received: from odin.tremily.us ([24.18.63.50])\r
27         by omta04.westchester.pa.mail.comcast.net with comcast\r
28         id 0H4J1o00X152l3L01H4KWf; Sat, 10 May 2014 17:04:19 +0000\r
29 Received: from mjolnir.tremily.us (unknown [192.168.0.140])\r
30         by odin.tremily.us (Postfix) with ESMTPS id 3B71F11969AD;\r
31         Sat, 10 May 2014 10:04:18 -0700 (PDT)\r
32 Received: (nullmailer pid 24537 invoked by uid 1000);\r
33         Sat, 10 May 2014 17:03:44 -0000\r
34 From: "W. Trevor King" <wking@tremily.us>\r
35 To: notmuch@notmuchmail.org\r
36 Subject: [PATCH v2 5/5] doc: Add rst2html support for building HTML docs\r
37 Date: Sat, 10 May 2014 10:03:36 -0700\r
38 Message-Id:\r
39  <5f852b5f1b0f84bb513d209b9ac1b731f2ec7fa8.1399740604.git.wking@tremily.us>\r
40 X-Mailer: git-send-email 1.9.1.353.gc66d89d\r
41 In-Reply-To: <cover.1399740604.git.wking@tremily.us>\r
42 References: <cover.1399740604.git.wking@tremily.us>\r
43 In-Reply-To: <cover.1399740604.git.wking@tremily.us>\r
44 References: <cover.1399740604.git.wking@tremily.us>\r
45 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net;\r
46         s=q20140121; t=1399741459;\r
47         bh=Gu36dE00/vied5NwRm3GgfkIjh9aF/4shKQ+Kr2TpYs=;\r
48         h=Received:Received:Received:Received:From:To:Subject:Date:\r
49         Message-Id;\r
50         b=wqwgmRNTGck7hnz5fimndg2Bk5uv86SNEtB5QzzniJUr7g9AtCYzJJ5BckDmpOLXr\r
51         Yk/wZEySlbQUc9KA1GmVxRlVZf3g8TzmUL5JKEdyPY9AaJhKDxDoiKH4ahRw62t5fN\r
52         AY8+gqACiOp4YJoRkDDX4nd+z+zh5qXZDc+pkeHR+xHMxwxELEU1UAVhH4VuIeBDhj\r
53         f0BG8+D5LBk8IMJL7sJBgBilCXr32GEI98m8klZqdHqDakEb/Cw1U2fq0+4GXCrsDg\r
54         tyKsdqLCouYZZwNSj85/XOfl5PrfbpmJTzZbXDPgbYfo5Fs7ZvtMd8tP4cHRzXFpCL\r
55         Obl1rcaw+qi1A==\r
56 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
57 X-BeenThere: notmuch@notmuchmail.org\r
58 X-Mailman-Version: 2.1.13\r
59 Precedence: list\r
60 List-Id: "Use and development of the notmuch mail system."\r
61         <notmuch.notmuchmail.org>\r
62 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
63         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
64 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
65 List-Post: <mailto:notmuch@notmuchmail.org>\r
66 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
67 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
69 X-List-Received-Date: Sat, 10 May 2014 17:04:33 -0000\r
70 \r
71 We already fall back to rst2man if Sphinx isn't available for building\r
72 the man pages.  With this commit we'll fall back to rst2html for\r
73 building the HTML docs too.  The only tricky bit here is that\r
74 HAVE_SPHINX explicitly checks for sphinx.writers.manpage.  I'm just\r
75 assuming sphinx.writers.html exists, to avoid adding a separate\r
76 SPHINX_HTML variable.  However, the HTML builder is Sphinx's default,\r
77 so it's hard to imagine it not being installed :p.  Perhaps it would\r
78 be better to drop the HAVE_* settings and SPHINXBUILD to use:\r
79 \r
80 * SPHINX2MAN empty for not-available, otherwise path to script that\r
81   can handle '-b manpage'\r
82 * SPHINX2HTML empty for not-available, otherwise path to script that\r
83   can handle '-b html'\r
84 * RST2MAN empty for not-available, otherwise path to script\r
85 * RST2HTML empty for not-available, otherwise path to script\r
86 \r
87 I'm sticking with the less intrusive change for now, but I'm happy\r
88 with either approach.\r
89 ---\r
90  configure          | 26 +++++++++++++++++++++++++-\r
91  doc/INSTALL        |  7 +++++--\r
92  doc/Makefile.local |  2 ++\r
93  3 files changed, 32 insertions(+), 3 deletions(-)\r
94 \r
95 diff --git a/configure b/configure\r
96 index f017af8..8fb3d19 100755\r
97 --- a/configure\r
98 +++ b/configure\r
99 @@ -414,8 +414,10 @@ if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev\r
100      have_sphinx=1\r
101      have_rst2man=0\r
102      RST2MAN=\r
103 +    have_rst2html=0\r
104 +    RST2HTML=\r
105  else\r
106 -    printf "No (falling back to rst2man).\n"\r
107 +    printf "No (falling back to Docutils).\n"\r
108      have_sphinx=0\r
109  \r
110      printf "Checking if rst2man is available... "\r
111 @@ -432,6 +434,21 @@ else\r
112         RST2MAN=\r
113         printf "No (so will not install man pages).\n"\r
114      fi\r
115 +\r
116 +    printf "Checking if rst2html is available... "\r
117 +    if rst2html -V > /dev/null 2>&1; then\r
118 +       have_rst2html=1\r
119 +       RST2HTML=$(command -v rst2html)\r
120 +       printf "Yes (${RST2HTML}).\n"\r
121 +    elif rst2man.py -V > /dev/null 2>&1; then\r
122 +       have_rst2html=1\r
123 +       RST2HTML=$(command -v rst2html.py)\r
124 +       printf "Yes (${RST2HTML}).\n"\r
125 +    else\r
126 +       have_rst2html=0\r
127 +       RST2HTML=\r
128 +       printf "No (so can not build HTML docs).\n"\r
129 +    fi\r
130  fi\r
131  \r
132  libdir_in_ldconfig=0\r
133 @@ -831,6 +848,13 @@ HAVE_RST2MAN=${have_rst2man}\r
134  # an empty string if no such program is available.\r
135  RST2MAN=${RST2MAN}\r
136  \r
137 +# Whether there's a rst2html binary available for building documentation\r
138 +HAVE_RST2HTML=${have_rst2html}\r
139 +\r
140 +# The path to the rst2html program for building documentation.  Set to\r
141 +# an empty string if no such program is available.\r
142 +RST2HTML=${RST2HTML}\r
143 +\r
144  # The directory to which desktop files should be installed\r
145  desktop_dir = \$(prefix)/share/applications\r
146  \r
147 diff --git a/doc/INSTALL b/doc/INSTALL\r
148 index 8352f7b..bd00dcf 100644\r
149 --- a/doc/INSTALL\r
150 +++ b/doc/INSTALL\r
151 @@ -20,8 +20,8 @@ Building with Docutils\r
152  \r
153  If you don't have Sphinx installed, you can use Docutils_ with the\r
154  same targets outlined above for Sphinx.  The Docutils converters\r
155 -(rst2man, rst2html, etc.) are used instead of Sphinx.  Only the man\r
156 -targets are currently supported.\r
157 +(rst2man, rst2html, etc.) are used instead of Sphinx.  Only the HTML\r
158 +and man targets are currently supported.\r
159  \r
160  Configuring the builder\r
161  -----------------------\r
162 @@ -36,5 +36,8 @@ your ``PATH`` and sets an appropriate ``RST2MAN`` in\r
163  ``Makefile.config``.  If neither ``HAVE_SPHINX`` nor ``HAVE_RST2MAN``\r
164  is 1, attempting to build the documentation will fail with an error.\r
165  \r
166 +A parallel set of variables (``HAVE_RST2HTML`` and ``RST2HTML``) is\r
167 +used when building HTML docs with Docutills.\r
168 +\r
169  .. _Sphinx: http://sphinx-doc.org/\r
170  .. _Docutils: http://docutils.sourceforge.net/\r
171 diff --git a/doc/Makefile.local b/doc/Makefile.local\r
172 index 49aa6dd..d78844a 100644\r
173 --- a/doc/Makefile.local\r
174 +++ b/doc/Makefile.local\r
175 @@ -23,6 +23,8 @@ ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)\r
176  build-html:\r
177  ifeq ($(HAVE_SPHINX),1)\r
178         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCBUILDDIR)/html\r
179 +else ifeq ($(HAVE_RST2HTML),1)\r
180 +       $(prerst2x) "$(RST2HTML)" $(srcdir)/doc $(DOCBUILDDIR)/html html\r
181  else\r
182         @echo "fatal: no Sphinx, cannot build HTML docs"\r
183         @false\r
184 -- \r
185 1.9.1.353.gc66d89d\r
186 \r