#!/usr/bin/perl -w require 5.008; use bytes; use strict; # run on the output of: # cvs2cl --separate-header --no-wrap # or vanilla cvs2cl it seems... my $title = 'ChangeLog'; $title = "$ARGV[0] $title" if defined $ARGV[0]; print < $title
END my $rec; while () { if (/^\d/) { print_entry($rec) if defined($rec); $rec = ''; } $rec .= $_; } print_entry($rec) if defined($rec); print < END sub print_entry { my ($hdr, $rec) = split /\n/, shift, 2; $hdr = html($hdr); $hdr =~ s/ /  /; $hdr =~ s/ +/ /g; print "
", $hdr, "
\n"; $rec =~ s/^\s*\*\s*//; $rec = html($rec); $rec =~ s/\s*\n\n\s*/

/g; $rec =~ s/^\s*/

/; $rec =~ s/\s*$/

/; $rec =~ s/^\s+//mg; $rec =~ s/\s+$//mg; $rec =~ s/ +/ /g; print "

", $rec, "
\n"; } sub html { my $t = shift; $t =~ s/&/&/g; $t =~ s//>/g; return $t; }