1 # Usage: rofftoc PerlTOC.xxx.raw
3 # Post-processes roffitall output. Called from roffitall to produce
4 # a formatted table of contents.
6 # Author: Tom Christiansen
14 .tl ''\fB\s+2Perl Table of Contents\s0\fR''
20 .tl ''\fB\s+5Perl Table of Contents\s0\fR''
28 ($type, $page, $desc) = split ' ', $_, 3;
29 $desc =~ s/^"(.*)"$/$1/;
30 if ($type eq 'Title') {
31 ($name = $desc) =~ s/ .*//;
33 } elsif ($type eq 'Name') {
34 #print STDERR $page, "\t", $desc;
42 } elsif ($type eq 'Header') {
43 print ".br\n", $page, "\t", $desc;
44 } elsif ($type eq 'Subsection') {
45 print ".br\n", $page, "\t\t", $desc;
46 } elsif ($type eq 'Item') {
47 next if $desc =~ /\\bu/;
48 next unless $name =~ /POSIX|func/i;
49 print ".br\n", $page, "\t\t\t", $desc;
53 Index:Title 1 "PERL 1"
54 Index:Name 1 "perl - Practical Extraction and Report Language"
56 Index:Header 1 "SYNOPSIS"
57 Index:Header 2 "DESCRIPTION"
58 Index:Item 2 "\(bu Many usability enhancements"
59 Index:Item 2 "\(bu Simplified grammar"
60 Index:Item 2 "\(bu Lexical scoping"
61 Index:Item 2 "\(bu Arbitrarily nested data structures"
62 Index:Item 2 "\(bu Modularity and reusability"