3 # $Id: filter2docs.pl,v 1.4 2008/05/11 15:33:35 fabiankeil Exp $
4 # $Source: /cvsroot/ijbswa/current/utils/filter2docs.pl,v $
6 # Parse the filter names and descriptions from a filter file and
7 # spit out copy&paste-ready markup for the various places in
8 # configuration and documentation where all filters are listed.
13 my (%comment_lines, %action_lines, %sgml_source_1, %sgml_source_2);
17 die "Usage: $0 filter-file\n" unless (@ARGV == 1) ;
18 open(INPUT, "< $ARGV[0]") or die "Coudln't open input file $ARGV[0] because $!\n";
26 if (/^((?:(?:SERVER|CLIENT)-HEADER-)?(?:FILTER|TAGGER)): ([-\w]+) (.*)$/) {
30 my $type = lc($type_uc);
32 my $white_space = ' ' x (($type eq 'filter' ? 20 : 27) - length($name));
34 $comment_lines{$type} .= "# $name:" . $white_space . "$description\n";
35 $action_lines{$type} .= "+$type" . "{$name} \\\n";
36 $sgml_source_1{$type} .= " <para>\n <anchor id=\"$type-$name\">\n" .
37 " <screen>+$type" . "{$name}" . $white_space .
38 "# $description</screen>\n </para>\n";
39 $sgml_source_2{$type} .= ' -<link linkend="' . $type_uc . "-" .
40 uc($name) . "\">$type" . "{$name}</link> \\\n";
49 'server-header-filter',
50 'client-header-filter',
51 'server-header-tagger',
52 'client-header-tagger'
55 foreach my $type (@filter_types) {
57 next unless defined $action_lines{$type};
63 Producing $type markup:
65 Comment lines for default.action:
68 Block of $type actions for standard.action:
71 SGML Source for AF chapter in U-M:
74 SGML Source for AF Tutorial chapter in U-M: