3 # $Id: filter2docs.pl,v 1.8 2013/03/02 14:38:38 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 "Couldn't open input file $ARGV[0]: $!\n";
35 if (/^((?:(?:SERVER|CLIENT)-HEADER-)?(?:FILTER|TAGGER)): ([-\w]+) (.*)$/) {
39 my $type = lc($type_uc);
40 my $sgml_description = sgml_escape($description);
41 my $white_space = ' ' x (($type eq 'filter' ? 20 : 27) - length($name));
43 $comment_lines{$type} .= "# $name:" . $white_space . "$description\n";
44 $action_lines{$type} .= "+$type" . "{$name} \\\n";
45 $sgml_source_1{$type} .= " <para>\n <anchor id=\"$type-$name\">\n" .
46 " <screen>+$type" . "{$name}" . $white_space .
47 "# $sgml_description</screen>\n </para>\n";
48 $sgml_source_2{$type} .= ' -<link linkend="' . $type_uc . "-" .
49 uc($name) . "\">$type" . "{$name}</link> \\\n";
58 'server-header-filter',
59 'client-header-filter',
60 'server-header-tagger',
61 'client-header-tagger'
64 foreach my $type (@filter_types) {
66 next unless defined $action_lines{$type};
72 Producing $type markup:
74 Comment lines for default.action.master:
77 Block of $type actions for default.action.master:
80 SGML Source for AF chapter in U-M:
83 SGML Source for AF Tutorial chapter in U-M: