1 Return-Path: <tomi.ollila@iki.fi>
\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 A023A431FD6
\r
6 for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 09:42:35 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id gGLd9q-yLrb6 for <notmuch@notmuchmail.org>;
\r
16 Sun, 23 Feb 2014 09:42:28 -0800 (PST)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 11EC0431FCF
\r
19 for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 09:42:28 -0800 (PST)
\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])
\r
21 by guru.guru-group.fi (Postfix) with ESMTP id 04119100064;
\r
22 Sun, 23 Feb 2014 19:42:21 +0200 (EET)
\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
\r
25 Subject: Re: [RFC Patch v3 2/3] doc: add target rst2man to build man pages
\r
27 In-Reply-To: <1393114575-8756-3-git-send-email-david@tethera.net>
\r
28 References: <87fvo7btu8.fsf@qmul.ac.uk>
\r
29 <1393114575-8756-1-git-send-email-david@tethera.net>
\r
30 <1393114575-8756-3-git-send-email-david@tethera.net>
\r
31 User-Agent: Notmuch/0.17+94~g1b90823 (http://notmuchmail.org) Emacs/24.3.1
\r
32 (x86_64-unknown-linux-gnu)
\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL
\r
34 $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F
\r
35 !)g;OY^,BjTbr)Np:%c_o'jj,Z
\r
36 Date: Sun, 23 Feb 2014 19:42:21 +0200
\r
37 Message-ID: <m24n3pu3nm.fsf@guru.guru-group.fi>
\r
39 Content-Type: text/plain
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Sun, 23 Feb 2014 17:42:35 -0000
\r
54 On Sun, Feb 23 2014, David Bremner <david@tethera.net> wrote:
\r
56 > Many people have docutils installed, but not sphinx. Allow these
\r
57 > people to build the man pages.
\r
59 +1 from me to start having manuals in reStructuredText format and
\r
60 then converting these to the target formats. Some comments on
\r
61 the patch series below:
\r
63 Building any docs using this is not yet activated ?
\r
65 Anyway, I tried to build manual pages using 'make man' and got this:
\r
68 sphinx-build -b man -d doc/_build/doctrees -q -c doc doc doc/_build/man
\r
69 Making output directory...
\r
72 Builder name man not registered
\r
74 No fallback to use rst2man...
\r
77 Comments regarding prerst2man.py inline below:
\r
85 > diff --git a/doc/rst2man/prerst2man.py b/doc/rst2man/prerst2man.py
\r
86 > new file mode 100644
\r
87 > index 0000000..797dd20
\r
89 > +++ b/doc/rst2man/prerst2man.py
\r
91 > +from sys import argv
\r
92 > +from datetime import date
\r
95 > +sourcedir=argv[1]
\r
98 Style! run pep8 prerst2html.py and fix the issues it prints
\r
99 to the screen, like ' = ' above and remove trailing semicolon
\r
100 below... (and also pep8(1) doc/conf.py.
\r
103 > +execfile(sourcedir+"/conf.py");
\r
108 > +def header(file,startdocname, command, description, authors, section):
\r
116 > +:Manual section: {:d}
\r
117 > +:Manual group: {:s}
\r
119 For python < 2.7 these needs to be {0:s}, {1:s}, {2:s}.. {5:d}...
\r
123 > +'-' * len(description),
\r
125 > +'-' * len(description),
\r
126 > +date.today().isoformat(),release,section,project))
\r
128 Replace date.today.isoformat() with date determined from other
\r
129 sources (NEWS file?)
\r
132 > +blankre = re.compile("^\s*$")
\r
133 > +for page in man_pages:
\r
134 > + outfile = open(outdir+"/"+page[0]+'.rst','w')
\r
135 > + infile = open(sourcedir+"/"+page[0]+".rst",'r')
\r
137 In addition to formatting above, use either ".rst" or '.rst'
\r
138 (and perhaps other quotations in these 2 lines) for consistency.
\r
142 > + # this is a crude hack. We look for the first blank line, and
\r
143 > + # insert the rst2man header there.
\r
145 > + # XXX consider really parsing input
\r
148 > + lines = infile.readlines()
\r
149 > + for line in lines:
\r
150 > + outfile.write(line);
\r
151 > + if (blankre.match(line)):
\r
153 > + count = count + 1
\r
155 > + del lines[0:count+1]
\r
157 pep8 will in the lime above (as it is not lines[0:count + 1])
\r
158 I might not have complained but... :D
\r
161 > + header(outfile,*page)
\r
163 > + outfile.write("".join(lines))
\r