Commit 7fe176c3 7fe176c3a04b15d5f519412b11b23e8f2aed6af1 by Sergey Poznyakoff

Fix generation of the doc files.

* doc/texinfo/Config: New file.
* doc/texinfo/Makefile.am (manual): Use texi2html.
* doc/texinfo/gendocs_template: Rewrite.
* doc/texinfo/maint.mk: Use VPATH to find source files.
Add the `clean' rule.
1 parent aa651ae9
1 # Texi2html configuration for GNU Mailutils documentation. -*- perl -*-
2 # Copyright (C) 2009, 2010, 2011 Sergey Poznyakoff
3 #
4 # GNU Mailutils is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3, or (at your option)
7 # any later version.
8 #
9 # GNU Mailutils is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16
17 $top_html_dir="";
18 $graphics_dir="$top_html_dir/graphics";
19
20 ## texi2html configuration
21
22 # Show TOC in place of the @contents directive.
23 $INLINE_CONTENTS = 1;
24 # Do not show Texinfo menus.
25 $SHOW_MENU = 0;
26 # Inhibit output of CSS lines in page headers.
27 $CSS_LINES='';
28 # Print footnotes at the end of each file (if the document is split).
29 $SEPARATED_FOOTNOTES = 0;
30
31 $BODYTEXT = "";
32
33 $EXTRA_HEAD="\
34 <link rev=\"made\" href=\"mailto:gray@gnu.org.ua\">\
35 <link rel=\"stylesheet\" type=\"text/css\" href=\"${top_html_dir}/gray.css\">\
36 <link rel=\"stylesheet\" type=\"text/css\" href=\"${top_html_dir}/texi.css\">\
37 <link rel=\"icon\" type=\"image/png\" href=\"${top_html_dir}/graphics/mustamp.png\">";
38
39 $AFTER_BODY_OPEN=qq{
40 <!--#include virtual=\"${top_html_dir}/inc/header.html\" -->
41 <ul class='tabs'>
42 <li><a href="${top_html_dir}/">Main</a></li>
43 <li><a href="${top_html_dir}/download.html">Downloads</a></li>
44 <li><a class="active" href="${top_html_dir}/manual.html">Documentation</a></li>
45 <li><a href="${top_html_dir}/wiki">Wiki</a></li>
46 </ul>
47 };
48
49 $PRE_BODY_CLOSE="Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.";
50
51 $format_map{'multitable'}='table class="multitable"';
52
53 $SMALL_RULE = '';
54 $DEFAULT_RULE = '';
55 $MIDDLE_RULE = '';
56 # This is output at the end of a section.
57 $BIG_RULE = '';
58
59 # Use navigation icons
60 $ICONS = 1;
61 %ACTIVE_ICONS =
62 (
63 'Top', "$graphics_dir/top.png",
64 'Contents', "$graphics_dir/ctx.png",
65 'Overview', '',
66 'Index', "$graphics_dir/idx.png",
67 'This', '',
68 'Back', "$graphics_dir/left.png",
69 'FastBack', "$graphics_dir/bwd.png",
70 'Prev', "",
71 'Up', "$graphics_dir/up.png",
72 'Next', "$graphics_dir/right.png",
73 'NodeUp', "$graphics_dir/left.png",
74 'NodeNext', "$graphics_dir/up.png",
75 'NodePrev', "$graphics_dir/right.png",
76 'Following', "$graphics_dir/right.png",
77 'Forward', "$graphics_dir/right.png",
78 'FastForward', "$graphics_dir/fwd.png",
79 'About' , '',
80 'First', '',
81 'Last', '',
82 ' ', ''
83 );
84
85 @SECTION_BUTTONS =
86 (
87 \&gray_document_title,
88 \&gray_sec_ref,
89 'Back', 'Forward',
90 \&gray_chap_ref, 'FastBack', 'Up', 'FastForward',
91 \&gray_doc_ref,
92 'Contents', 'Index',
93 ' ','About',
94 );
95
96 @SECTION_FOOTER_BUTTONS = @SECTION_BUTTONS;
97 @NODE_FOOTER_BUTTONS = @SECTION_BUTTONS;
98
99 # buttons for misc stuff
100 @MISC_BUTTONS = (
101 \&gray_document_title,
102 'Contents',
103 'Index',
104 ' ',
105 'About'
106 );
107
108
109 $print_section = \&gray_print_section;
110 $print_navigation = \&gray_print_navigation;
111 $print_head_navigation = \&gray_print_head_navigation;
112 $print_foot_navigation = \&gray_print_foot_navigation;
113 $print_About = \&gray_print_About;
114 $cell = \&gray_multitable_cell;
115 $print_page_foot = \&gray_print_page_foot;
116
117 sub gray_multitable_cell($$)
118 {
119 my $text = shift;
120 my $row_macro = shift;
121
122 $text =~ s/<p>//;
123 $text =~ s/<\/p>//;
124 if ($row_macro eq 'headitem')
125 {
126 return '<th>' . $text . '</th>';
127 }
128 return '<td>' . $text . '</td>';
129 }
130
131 sub gray_print_About
132 {
133 return &$print_misc(@_) if (!($SPLIT eq '') or $SECTION_NAVIGATION);
134 }
135
136 sub gray_split_status()
137 {
138 if ($SPLIT eq '') {
139 return '';
140 } elsif ($SPLIT eq 'node') {
141 return ' <span class="splitstatus">(split by node)</span>';
142 } elsif ($SPLIT eq 'section') {
143 return ' <span class="splitstatus">(split by section)</span>';
144 } elsif ($SPLIT eq 'chapter') {
145 return ' <span class="splitstatus">(split by chapter)</span>';
146 }
147 }
148
149 sub gray_document_title($$)
150 {
151 my $fh = shift;
152 my $vertical = shift;
153 my $status = gray_split_status();
154 print $fh qq{<td class="title">} . $Texi2HTML::THISDOC{title} . $status . ":</td>\n";
155 }
156
157 sub gray_node_ref($$)
158 {
159 my $fh = shift;
160 my $vertical = shift;
161 print $fh qq{<span class="navtext">Node:</span>};
162 }
163
164 sub gray_sec_ref($$)
165 {
166 my $fh = shift;
167 my $vertical = shift;
168 print $fh qq{<span class="navtext">Section:</span>};
169 }
170
171 sub gray_chap_ref($$)
172 {
173 my $fh = shift;
174 my $vertical = shift;
175 print $fh qq{<span class="navtext">Chapter:</span>};
176 }
177
178 sub gray_doc_ref($$)
179 {
180 my $fh = shift;
181 my $vertical = shift;
182 print $fh qq{<span class="navtext">Doc:</span>};
183 }
184
185 sub gray_print_navigation
186 {
187 my $fh = shift;
188 my $buttons = shift;
189 my $vertical = shift;
190 my $spacing = 1;
191 my $class="nav";
192
193 print $fh qq{<table class="nav">\n};
194
195 print $fh "<tr>" unless $vertical;
196 for my $button (@$buttons)
197 {
198 if ($button =~ /^\@class=(.*)/) {
199 $class = "$class $1";
200 next;
201 }
202 print $fh "<tr>\n" if $vertical;
203 print $fh qq{<td class="$class">};
204
205 if (ref($button) eq 'CODE')
206 {
207 &$button($fh, $vertical);
208 }
209 elsif (ref($button) eq 'SCALAR')
210 {
211 print $fh "$$button" if defined($$button);
212 }
213 elsif (ref($button) eq 'ARRAY')
214 {
215 my $text = $button->[1];
216 my $button_href = $button->[0];
217 # verify that $button_href is simple text and text is a reference
218 if (defined($button_href) and !ref($button_href)
219 and defined($text) and (ref($text) eq 'SCALAR') and defined($$text))
220 { # use given text
221 if ($Texi2HTML::HREF{$button_href})
222 {
223 print $fh "" .
224 &$anchor('',
225 $Texi2HTML::HREF{$button_href},
226 $$text
227 )
228 ;
229 }
230 else
231 {
232 print $fh $$text;
233 }
234 }
235 }
236 elsif ($button eq ' ')
237 { # handle space button
238 print $fh
239 ($ICONS && $ACTIVE_ICONS{' '}) ?
240 &$button_icon_img($BUTTONS_NAME{$button}, $ACTIVE_ICONS{' '}) :
241 $NAVIGATION_TEXT{' '};
242 #next;
243 }
244 elsif ($Texi2HTML::HREF{$button})
245 { # button is active
246 my $btitle = $BUTTONS_GOTO{$button} ?
247 'title="' . $BUTTONS_GOTO{$button} . '"' : '';
248 if ($ICONS && $ACTIVE_ICONS{$button})
249 { # use icon
250 print $fh '' .
251 &$anchor('',
252 $Texi2HTML::HREF{$button},
253 &$button_icon_img($BUTTONS_NAME{$button},
254 $ACTIVE_ICONS{$button},
255 $Texi2HTML::SIMPLE_TEXT{$button}),
256 $btitle
257 );
258 }
259 else
260 { # use text
261 print $fh
262 '' .
263 &$anchor('',
264 $Texi2HTML::HREF{$button},
265 $NAVIGATION_TEXT{$button},
266 $btitle
267 );
268 }
269 }
270 else { # button is passive
271 print $fh '<span class="passive">' .
272 ($ICONS && $PASSIVE_ICONS{$button} ?
273 &$button_icon_img($BUTTONS_NAME{$button},
274 $PASSIVE_ICONS{$button},
275 $Texi2HTML::SIMPLE_TEXT{$button}) :
276
277 $NAVIGATION_TEXT{$button}) . '</span>';
278 }
279 print $fh "</td>\n";
280 print $fh "</tr>\n" if $vertical;
281 $class = "nav";
282 }
283 print $fh "</tr>" unless $vertical;
284 print $fh "</table>\n";
285 }
286
287 sub gray_print_head_navigation($$)
288 {
289 my $fh = shift;
290 my $buttons = shift;
291
292 return if ($SPLIT eq '');
293 if ($VERTICAL_HEAD_NAVIGATION)
294 {
295 print $fh <<EOT;
296 <table class='nav'>
297 <tr>
298 <td>
299 EOT
300 }
301 main::print_lines($fh, $Texi2HTML::THIS_HEADER);
302 &$print_navigation($fh, $buttons, $VERTICAL_HEAD_NAVIGATION);
303 if ($VERTICAL_HEAD_NAVIGATION)
304 {
305 print $fh <<EOT;
306 </td>
307 <td>
308 EOT
309 }
310 }
311
312 sub gray_print_foot_navigation
313 {
314 my $fh = shift;
315
316 return if ($SPLIT eq '');
317 if ($VERTICAL_HEAD_NAVIGATION)
318 {
319 print $fh <<EOT;
320 </td>
321 </tr>
322 </table>
323 EOT
324 }
325 }
326
327 sub gray_print_page_foot($)
328 {
329 my $fh = shift;
330 my $program_string = program_string();
331 print $fh <<EOT;
332 <div class="copyright">
333 $program_string
334 EOT
335 if (defined($PRE_BODY_CLOSE) && $PRE_BODY_CLOSE) {
336 print $fh "<p>$PRE_BODY_CLOSE</p>";
337 }
338 print $fh <<EOT;
339 </div>
340 </body>
341 </html>
342 EOT
343 }
344
345 sub gray_print_section
346 {
347 my $fh = shift;
348 my $first_in_page = shift;
349 my $previous_is_top = shift;
350 my $buttons = \@SECTION_BUTTONS;
351
352 if ($first_in_page) {
353 &$print_head_navigation($fh, $buttons)
354 } else {
355 main::print_lines($fh, $Texi2HTML::THIS_HEADER);
356 }
357 my $nw = main::print_lines($fh);
358 if (defined $SPLIT
359 and ($SPLIT eq 'node')) {
360 &$print_foot_navigation($fh);
361 print $fh "$SMALL_RULE\n";
362 &$print_navigation($fh, \@NODE_FOOTER_BUTTONS) if (!defined($WORDS_IN_PAGE) or (defined ($nw)
363 and $nw >= $WORDS_IN_PAGE));
364 }
365 }
...@@ -94,7 +94,7 @@ manual: ...@@ -94,7 +94,7 @@ manual:
94 TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \ 94 TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
95 MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \ 95 MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS)" \
96 TEXI2DVI="$(TEXI2DVI) -t @finalout" \ 96 TEXI2DVI="$(TEXI2DVI) -t @finalout" \
97 $(GENDOCS) $(PACKAGE) '$(PACKAGE_NAME) manual' 97 $(GENDOCS) --texi2html $(PACKAGE) '$(PACKAGE_NAME) manual'
98 98
99 99
100 EXTRA_DIST=gendocs_template mastermenu.el untabify.el 100 EXTRA_DIST=gendocs_template mastermenu.el untabify.el
......
1 <?xml version="1.0" encoding="utf-8" ?> 1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4 <!-- $Id$ --> 4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
6 5
7 <head> 6 <head>
8 <title>%%TITLE%% - GNU Project - Free Software Foundation (FSF)</title> 7 <title>Mailutils</title>
9 <meta http-equiv="content-type" content='text/html; charset=utf-8' /> 8 <link rev="made" href="mailto:gray@gnu.org.ua" />
10 <link rel="stylesheet" type="text/css" href="/gnu.css" /> 9 <link rel="stylesheet" type="text/css" href="/gray.css" />
11 <link rev="made" href="mailto:gray@gnu.org" /> 10 <link rel="icon" type="image/png" href="/graphics/mustamp.png" />
12 <link rel="icon" type="image/png" href="/graphics/gnu-head-icon.png" />
13 </head> 11 </head>
14
15 <!-- This document is in XML, and xhtml 1.0 -->
16 <!-- Please make sure to properly nest your tags -->
17 <!-- and ensure that your final document validates -->
18 <!-- consistent with W3C xhtml 1.0 and CSS standards -->
19 <!-- See validator.w3.org -->
20
21 <body> 12 <body>
13 <!--#include virtual="/inc/header.html" -->
14 <ul class='tabs'>
15 <li><a href="/">Main</a></li>
16 <li><a href="/download.html">Downloads</a></li>
17 <li><a class="active" href="/manual">Documentation</a></li>
18 <li><a href="/wiki">Wiki</a></li>
19 </ul>
22 20
23 <h3>%%TITLE%%</h3> 21 <div id="main">
24 22 <p>The manual for <b>%%PACKAGE%%</b> is available in the following formats:</p>
25 <address>Free Software Foundation</address>
26 <address>last updated %%DATE%%</address>
27 <p>
28 <a href="/graphics/gnu-head.jpg">
29 <img src="/graphics/gnu-head-sm.jpg"
30 alt=" [image of the head of a GNU] "
31 width="129" height="122" />
32 </a>
33 <a href="/philosophy/gif.html">(no gifs due to patent problems)</a>
34 </p>
35 <hr />
36
37 <p>The manual for %%PACKAGE%% is available in the following formats:</p>
38 23
39 <ul> 24 <ul>
40 <li><a href="%%PACKAGE%%.html">HTML 25 <li><a href="manual/%%PACKAGE%%.html">HTML
41 (%%HTML_MONO_SIZE%%K characters)</a> - entirely on one web page.</li> 26 (%%HTML_MONO_SIZE%%K bytes)</a> - entirely on one web page.</li>
42 <li><a href="html_node/index.html">HTML</a> - with one web page per 27 <li><a href="manual/html_node/index.html">HTML</a> - with one web page per
43 node.</li> 28 node.</li>
44 <li><a href="%%PACKAGE%%.html.gz">HTML compressed 29 %%IF HTML_SECTION%%
30 <li><a href="manual/html_section/index.html">HTML</a> - with one web page per
31 section.</li>
32 %%ENDIF HTML_SECTION%%
33 %%IF HTML_CHAPTER%%
34 <li><a href="manual/html_chapter/index.html">HTML</a> - with one web page per
35 chapter.</li>
36 %%ENDIF HTML_CHAPTER%%
37 <li><a href="manual/%%PACKAGE%%.html.gz">HTML compressed
45 (%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on 38 (%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
46 one web page.</li> 39 one web page.</li>
47 <li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed 40 <li><a href="manual/%%PACKAGE%%.html_node.tar.gz">HTML compressed
48 (%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> - 41 (%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
49 with one web page per node.</li> 42 with one web page per node.</li>
50 <li><a href="%%PACKAGE%%.info.tar.gz">Info document 43 %%IF HTML_SECTION%%
44 <li><a href="manual/%%PACKAGE%%.html_section.tar.gz">HTML compressed
45 (%%HTML_SECTION_TGZ_SIZE%%K gzipped tar file)</a> -
46 with one web page per section.</li>
47 %%ENDIF HTML_SECTION%%
48 %%IF HTML_CHAPTER%%
49 <li><a href="manual/%%PACKAGE%%.html_chapter.tar.gz">HTML compressed
50 (%%HTML_CHAPTER_TGZ_SIZE%%K gzipped tar file)</a> -
51 with one web page per chapter.</li>
52 %%ENDIF HTML_CHAPTER%%
53 <li><a href="manual/%%PACKAGE%%.info.tar.gz">Info document
51 (%%INFO_TGZ_SIZE%%K characters gzipped tar file)</a>.</li> 54 (%%INFO_TGZ_SIZE%%K characters gzipped tar file)</a>.</li>
52 <li><a href="%%PACKAGE%%.txt">ASCII text 55 <li><a href="manual/%%PACKAGE%%.txt">ASCII text
53 (%%ASCII_SIZE%%K characters)</a>.</li> 56 (%%ASCII_SIZE%%K characters)</a>.</li>
54 <li><a href="%%PACKAGE%%.txt.gz">ASCII text compressed 57 <li><a href="manual/%%PACKAGE%%.txt.gz">ASCII text compressed
55 (%%ASCII_GZ_SIZE%%K gzipped characters)</a>.</li> 58 (%%ASCII_GZ_SIZE%%K gzipped characters)</a>.</li>
56 <li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file 59 <li><a href="manual/%%PACKAGE%%.dvi.gz">TeX dvi file
57 (%%DVI_GZ_SIZE%%K characters gzipped)</a>.</li> 60 (%%DVI_GZ_SIZE%%K characters gzipped)</a>.</li>
58 <li><a href="%%PACKAGE%%.ps.gz">PostScript file 61 <li><a href="manual/%%PACKAGE%%.ps.gz">PostScript file
59 (%%PS_GZ_SIZE%%K characters gzipped)</a>.</li> 62 (%%PS_GZ_SIZE%%K characters gzipped)</a>.</li>
60 <li><a href="%%PACKAGE%%.pdf">PDF file 63 <li><a href="manual/%%PACKAGE%%.pdf">PDF file
61 (%%PDF_SIZE%%K characters)</a>.</li> 64 (%%PDF_SIZE%%K characters)</a>.</li>
62 <li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source 65 <li><a href="manual/%%PACKAGE%%.texi.tar.gz">Texinfo source
63 (%%TEXI_TGZ_SIZE%%K characters gzipped tar file)</a></li> 66 (%%TEXI_TGZ_SIZE%%K characters gzipped tar file)</a></li>
64 </ul> 67 </ul>
65 68
66 <p>(This page generated by the <a 69 </div>
70 <div class="generator">
71 <p>(This page is generated by the <a
67 href="%%SCRIPTURL%%">%%SCRIPTNAME%%</a> script.) 72 href="%%SCRIPTURL%%">%%SCRIPTNAME%%</a> script.)
68 </p> 73 </p>
69
70 <p>
71 <a href="http://validator.w3.org/check?uri=referer"><img
72 src="http://www.w3.org/Icons/valid-xhtml10"
73 alt="Valid XHTML 1.0!" height="31" width="88" /></a>
74 </p>
75
76 <div class="copyright">
77 <p>
78 Return to the <a href="/home.html">GNU Project home page</a>.
79 </p>
80 <p>
81 Return to <a href="/software/%%PACKAGE%%">GNU %%PACKAGE%% home page</a>.
82 </p>
83 <p>
84 Please send FSF &amp; GNU inquiries to
85 <a href="mailto:gnu@gnu.org"><em>gnu@gnu.org</em></a>.
86 There are also <a href="/home.html#ContactInfo">other ways to contact</a>
87 the FSF.
88 <br />
89 Please send broken links and other corrections (or suggestions) to
90 <a href="mailto:webmasters@gnu.org"><em>webmasters@gnu.org</em></a>.
91 </p>
92
93 <p>
94 Copyright (C) 2005, 2010, 2011 Free Software Foundation, Inc.,
95 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA
96 <br />
97 Verbatim copying and distribution of this entire article is
98 permitted in any medium, provided this notice is preserved.
99 </p>
100
101 <p>
102 Updated:
103 <!-- timestamp start -->
104 $Date$ $Author$
105 <!-- timestamp end -->
106 </p>
107 </div> 74 </div>
108 75
76 <!--#include virtual="/inc/footer.html" -->
109 </body> 77 </body>
110 </html> 78 </html>
......
...@@ -16,16 +16,18 @@ ...@@ -16,16 +16,18 @@
16 16
17 mu_aux_dir = ../../mu-aux 17 mu_aux_dir = ../../mu-aux
18 18
19 VPATH = ../../libmailutils/tests/:../../examples/
19 .SUFFIXES: .c .inc 20 .SUFFIXES: .c .inc
20 .c.inc: 21 .c.inc:
21 sed -f $(mu_aux_dir)/texify.sed $< > $@ 22 sed -f $(mu_aux_dir)/texify.sed $< > $@
22 23
23 all: addr.inc http.inc mailcap.inc numaddr.inc sfrom.inc url-parse.inc 24 all: addr.inc http.inc mailcap.inc numaddr.inc sfrom.inc url-parse.inc
24 25
25 addr.inc: ../../libmailutils/tests/addr.c 26 addr.inc: addr.c
26 http.inc: ../../examples/http.inc 27 http.inc: http.c
27 mailcap.inc: ../../libmailutils/tests/mailcap.c 28 mailcap.inc: mailcap.c
28 numaddr.inc: ../../examples/numaddr.inc 29 numaddr.inc: numaddr.c
29 sfrom.inc: ../../examples/sfrom.inc 30 sfrom.inc: sfrom.c
30 url-parse.inc: ../../libmailutils/tests/url-parse.inc 31 url-parse.inc: url-parse.c
31 32
33 clean:; rm -f *.inc
......