Debian Codegraph @

doc/make_html_index

raw
1 #!/usr/local/bin/perl
2 # Create HTML index from index of pre-installed info page.
3 # Bug: the @code{} items get lost, too bad.
4 $debug = 0; # change to 1 to get some debugging output
5 open(IN, "info -f ./gri.info 'Concept Index' | ")
6 || die "Cannot get 'Concept Index'\n";
7
8 print "
9 \@c HTML <!-- newfile ConceptIndex.html \"Gri: Concept Index\" \"Concept Index\" -->
10 \@c HTML <h1>Concept index</h1>
11 \@node Concept Index, Index of Builtins, Index of Builtins, Top
12
13 \@c HTML <b>Navigation</b>:
14 \@c HTML <a href=\"#CommandIndex\">next</a>,
15 \@c HTML <a href=\"#License\">previous</a>,
16 \@c HTML <a href=\"#Top\">parent</a>.
17
18 \@itemize \@bullet
19 ";
20
21 # Skip header ... this may be brittle, since how do we know how it's defined?
22 while(<IN>) {
23 chop;
24 #print "SKIPPING ($_)\n";
25 last if /Menu:/;
26 }
27
28 # Process the body.
29 while(<IN>) {
30 chop;
31 print "BEFORE [$_]\n" if $debug;
32 s/\s*\((line)\s*[0-9]+\)\s*//;
33 s/\s*$//;
34 print "AFTER [$_]\n" if $debug;
35 next if /^$/; # ignores "(line #)" lines, which occur for long items.
36 s/\* //;
37 s/\.$//;
38 s/:\s*/\n ... \@xref{/;
39 s/$/}/;
40 print "\@item\n $_\n";
41 }
42 print "\@end itemize\n";