#!/usr/bin/perl
$insection = 1;
$indl = 0;
while (<>)
{ if ($insection == 1)
{ if (/^##/)
{ s/##//; chop;
if ($indl == 1) {print "\n\n";}
print "
$_
\n";
$indl = 0;
}
else
{ if ($indl == 0) {print "\n"; $indl = 1;}
chop; print "\n- $_";
$times = <>; chop $times;
print "$times\n
- ";
}
$insection = 2;
}
else
{ if (/^\s*$/) {$insection = 1}
else { print }
}
}
if ($indl == 1) {print "
\n"; $indl = 0};