bold option item titles in pod
[barcat.git] / reformat-podusage
index c40363db20fa25f4636f135acfd90344e3464fba..4fe82a3e1c7a25428a57fd37eb0e24441492870d 100755 (executable)
@@ -5,24 +5,25 @@ use utf8;
 use open qw( :std :utf8 );
 use re '/msx';
 
-our $VERSION = '1.00';
+our $VERSION = '1.01';
 
 local $/ = undef;  # slurp
 my $source = readline;
 my $pod = $source;
 $pod =~ s/^=over\K/ 25/;  # indent options list
+$pod =~ s/[BC]<([^>]+)>/$1/g;  # unbolden
 $pod =~ s{
        ^=item \h \N*\n\n \N*\n \K  # first line
        (?: (?: ^=over .*? ^=back\n )? (?!=) \N*\n )*
 }{\n}g;  # abbreviate options
-$pod =~ s/[.,](?=\n)//g;  # trailing punctuation
 $pod =~ s/^=item\ \K(?=--)/____/g;  # align long options
 # abbreviate <variable> indicators
 $pod =~ s/\Q>.../s>/g;
-$pod =~ s/<(?:number|count|seconds)>/N/g;
-$pod =~ s/<character(s?)>/\Uchar$1/g;
+$pod =~ s/I<(?:number|count|seconds)>/N/g;
+$pod =~ s/I<character(s?)>/\Uchar$1/g;
 $pod =~ s/\Q | /|/g;
-$pod =~ s/(?<!\w)<([a-z]+)>/\U$1/g;  # uppercase
+$pod =~ s/I<([a-z]+)> (?![.,])/\U$1/g;  # uppercase
+$pod =~ s/[.,](?=\n)//g;  # trailing punctuation
 
 require Pod::Usage;
 my $parser = Pod::Usage->new(USAGE_OPTIONS => {