aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJohn Beppu <beppu@lbox.org>2001-02-23 17:41:41 +0000
committerJohn Beppu <beppu@lbox.org>2001-02-23 17:41:41 +0000
commit8373e70c55805bc933cf11d0150182fe3b80a3b2 (patch)
tree2c57d7e84bbc39ad8363a2fb0094c56e64f95c27 /docs
parent7a9cc2dcdd58e4e98b71b220e9430d71047098ab (diff)
downloadbusybox-w32-8373e70c55805bc933cf11d0150182fe3b80a3b2.tar.gz
busybox-w32-8373e70c55805bc933cf11d0150182fe3b80a3b2.tar.bz2
busybox-w32-8373e70c55805bc933cf11d0150182fe3b80a3b2.zip
During POD generation, it inserts a blank line before lines
that were intended to be indented.
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/autodocifier.pl22
1 files changed, 17 insertions, 5 deletions
diff --git a/docs/autodocifier.pl b/docs/autodocifier.pl
index fc4acadc8..e02bca93e 100755
--- a/docs/autodocifier.pl
+++ b/docs/autodocifier.pl
@@ -44,14 +44,26 @@ sub pod_for_usage {
44 my $name = shift; 44 my $name = shift;
45 my $usage = shift; 45 my $usage = shift;
46 46
47 # make options bold
47 my $trivial = $usage->{trivial}; 48 my $trivial = $usage->{trivial};
48 $trivial =~s/(?<!\w)(-\w+)/B<$1>/sxg; 49 $trivial =~s/(?<!\w)(-\w+)/B<$1>/sxg;
49 50 my @f1;
50 my $full = 51 my @f0 =
51 join("\n",
52 map { $_ !~ /^\s/ && s/(?<!\w)(-\w+)/B<$1>/g; $_ } 52 map { $_ !~ /^\s/ && s/(?<!\w)(-\w+)/B<$1>/g; $_ }
53 split("\n", $usage->{full})); 53 split("\n", $usage->{full});
54
55 # add "\n" prior to certain lines to make indented
56 # lines look right
57 my $len = @f0;
58 for (my $i = 0; $i < $len; $i++) {
59 push @f1, $f0[$i];
60 if (($i+1) != $len && $f0[$i] !~ /^\s/ && $f0[$i+1] =~ /^\s/) {
61 next if ($f0[$i] =~ /^$/);
62 push(@f1, "") unless ($f0[$i+1] =~ /^\s*$/s);
63 }
64 }
54 65
66 my $full = join("\n", @f1);
55 return 67 return
56 "-------------------------------\n". 68 "-------------------------------\n".
57 "\n". 69 "\n".
@@ -180,4 +192,4 @@ John BEPPU <beppu@lineo.com>
180 192
181=cut 193=cut
182 194
183# $Id: autodocifier.pl,v 1.7 2001/02/23 16:16:08 beppu Exp $ 195# $Id: autodocifier.pl,v 1.8 2001/02/23 17:41:41 beppu Exp $