During POD generation, it inserts a blank line before lines
authorJohn Beppu <beppu@lbox.org>
Fri, 23 Feb 2001 17:41:41 +0000 (17:41 -0000)
committerJohn Beppu <beppu@lbox.org>
Fri, 23 Feb 2001 17:41:41 +0000 (17:41 -0000)
that were intended to be indented.

docs/autodocifier.pl

index fc4acadc84f69ff5b91a1a93661e24ca56cb3972..e02bca93ebf1fcf5ec26bd7ca51bae4bd992696c 100755 (executable)
@@ -44,14 +44,26 @@ sub pod_for_usage {
        my $name  = shift;
        my $usage = shift;
 
+       # make options bold
        my $trivial = $usage->{trivial};
        $trivial =~s/(?<!\w)(-\w+)/B<$1>/sxg;
-
-       my $full = 
-               join("\n",
+       my @f1;
+       my @f0 = 
                map { $_ !~ /^\s/ && s/(?<!\w)(-\w+)/B<$1>/g; $_ }
-               split("\n", $usage->{full}));
+               split("\n", $usage->{full});
+
+       # add "\n" prior to certain lines to make indented
+       # lines look right
+       my $len = @f0;
+       for (my $i = 0; $i < $len; $i++) {
+               push @f1, $f0[$i];
+               if (($i+1) != $len && $f0[$i] !~ /^\s/ && $f0[$i+1] =~ /^\s/) {
+                       next if ($f0[$i] =~ /^$/);
+                       push(@f1, "") unless ($f0[$i+1] =~ /^\s*$/s);
+               }
+       }
 
+       my $full = join("\n", @f1);
        return
                "-------------------------------\n".
                "\n".
@@ -180,4 +192,4 @@ John BEPPU <beppu@lineo.com>
 
 =cut
 
-# $Id: autodocifier.pl,v 1.7 2001/02/23 16:16:08 beppu Exp $
+# $Id: autodocifier.pl,v 1.8 2001/02/23 17:41:41 beppu Exp $