From: oes Date: Sun, 16 Mar 2003 15:32:44 +0000 (+0000) Subject: Added small script that saves typing after filter changes X-Git-Tag: v_3_0_1~29 X-Git-Url: http://www.privoxy.org/gitweb/@user-manual@?a=commitdiff_plain;h=af49d78ab68bfeac664df71aabae624a76253809;p=privoxy.git Added small script that saves typing after filter changes --- 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");