(1) New Wish. (2) Typo and tabs in FAQ source.
[exim.git] / doc / doc-scripts / DoConts
CommitLineData
495ae4b0
PH
1#! /usr/bin/perl -w
2# $Cambridge: exim/doc/doc-scripts/DoConts,v 1.1 2004/10/07 15:04:35 ph10 Exp $
3
4$style = (@ARGV > 0)? $ARGV[0] : "a4ps";
5
6open(IN, "z-rawindex") || die "Can't open z-rawindex\n";
7open(OUT, ">z-contents") || die "Can't open z-contents\n";
8
9print OUT <<'EOF';
10.if ~~sys.fancy
11.linelength ~~sys.linelength + 0.2in
12.pagedepth ~~sys.pagedepth - 0.2in
13.linedepth 12.24
14.fi
15.include "markup.sg"
16.set chapter -1
17.set p 0
18.format p roman
19.tabset 2em 2em
20.
21.foot
22.set p ~~sys.pagenumber
23$c [~~p]
24.endfoot
25.
26.chapter Contents
27.disable filling
28.justify left
29EOF
30
31while(<IN>)
32 {
33 if (/\$e/)
34 {
35 s/\$e\s*$//; # "see also" lines have no line number
36 s/--\s*\d+$//; # remove "extra" number for index page
37
38 s/\n$//; # trailing newline
39
40 if (!/^\$/)
41 {
42 print OUT ".blank\n";
43 print OUT ".if ~~sys.leftonpage < 2*~~sys.linedepth\n";
44 print OUT ".newpage\n";
45 print OUT ".fi\n";
46 print OUT "\$shead\{$_\}\n";
47 print OUT ".blank\n";
48 }
49 else
50 {
51 print OUT "$_\n";
52 }
53 }
54 }
55
56close(IN);
57close(OUT);
58
59system("sgcal z-contents -to zc-gcode -style $style -index /dev/null");
60if ($style eq "a4ps")
61 {
62 system("sgtops zc-gcode -to zc-ps");
63 print "PostScript in zc-ps\n";
64 }
65else
66 {
67 system("mv -f zc-gcode zc-txt");
68 print "Text in zc-txt\n";
69 }
70
71# End