From af49d78ab68bfeac664df71aabae624a76253809 Mon Sep 17 00:00:00 2001 From: oes Date: Sun, 16 Mar 2003 15:32:44 +0000 Subject: [PATCH] Added small script that saves typing after filter changes --- utils/filter2docs.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 utils/filter2docs.pl diff --git a/utils/filter2docs.pl b/utils/filter2docs.pl new file mode 100755 index 00000000..053ab2c1 --- /dev/null +++ b/utils/filter2docs.pl @@ -0,0 +1,25 @@ +#!/usr/bin/perl -w + +# $Id: $ +# $Source: $ + +# Parse the filter names and descriptions from a filter file and +# spit out copy&paste-ready markup for the various places in +# configuration and documentation where all filters are listed. + +die "Usage: $0 filter-file\n" unless (@ARGV == 1) ; +open(INPUT, "< $ARGV[0]") or die "Coudln't open input file $ARGV[0] because $!\n"; + +while () { + if (/^FILTER: ([-\w]+) (.*)$/) { + $comment_lines .= "# $1:" . (" " x (20-length($1))) . "$2\n"; + $action_lines .= "-filter{$1} \\\n"; + $sgml_source_1 .= " \n \n +filter{$1}" . + (" " x (20-length($1))) . "# $2\n \n"; + $sgml_source_2 .= " -filter{$1} \\\n"; + } +} + +print("Comment lines for default.action:\n\n$comment_lines\n\nBlock of filter actions for" + ." standard.action:\n\n$action_lines\n\nSGML Source for AF chapter in U-M:" . + "\n\n$sgml_source_1\n\nSGML Source for AF Tutorial chapter in U-M\n\n$sgml_source_2\n"); -- 2.39.2