From: Fabian Keil Date: Mon, 9 Jun 2008 17:53:02 +0000 (+0000) Subject: Add a filter to make updating the "What's New in this Release" X-Git-Tag: v_3_0_9~47 X-Git-Url: http://www.privoxy.org/gitweb/%40user-manual%40%40actions-help-prefix%40TREAT_FORBIDDEN_CONNECTS_LIKE_BLOCKS?a=commitdiff_plain;h=078c345f510037f52ccc0f831822b968a42e3f0a;p=privoxy.git Add a filter to make updating the "What's New in this Release" section in the User Manual less painful. --- diff --git a/utils/changelog2doc.pl b/utils/changelog2doc.pl new file mode 100755 index 00000000..adf2f922 --- /dev/null +++ b/utils/changelog2doc.pl @@ -0,0 +1,66 @@ +#!/usr/bin/perl + +# $Id:$ +# $Source:$ + +# Filter to parse the ChangeLog and translate the changes for +# the most recent version into something that looks like markup +# for the documentation but still needs fine-tuning. + +use strict; +use warnings; + +my @entries; + +sub read_entries() { + my $section_reached = 0; + my $i = -1; + + while (<>) { + if (/^\*{3} /) { + last if $section_reached; + $section_reached = 1; + next; + } + next unless $section_reached; + next if /^\s*$/; + + if (/^-/) { + $i++; + $entries[$i] = ''; + } + s@^-?\s*@@; + + $entries[$i] .= $_; + } + print "Parsed $i entries.\n"; +} + +sub generate_markup() { + my $markup = ''; + + $markup .= "\n" . + " \n"; + + foreach my $entry (@entries) { + chomp $entry; + $entry =~ s@\n@\n @g; + $markup .= " \n" . + " \n" . + " " . $entry . "\n" . + " \n" . + " \n" + ; + } + $markup .= " \n" . + "\n"; + + print $markup; +} + +sub main () { + read_entries(); + generate_markup(); +} + +main();