From 078c345f510037f52ccc0f831822b968a42e3f0a Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 9 Jun 2008 17:53:02 +0000 Subject: [PATCH] Add a filter to make updating the "What's New in this Release" section in the User Manual less painful. --- utils/changelog2doc.pl | 66 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100755 utils/changelog2doc.pl 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(); -- 2.39.2