From ae05c1b34a7ac87646bdf7491378cba69f4db5e1 Mon Sep 17 00:00:00 2001 From: beppu Date: Fri, 23 Feb 2001 17:41:41 +0000 Subject: During POD generation, it inserts a blank line before lines that were intended to be indented. git-svn-id: svn://busybox.net/trunk/busybox@1920 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- docs/autodocifier.pl | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'docs') 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 { my $name = shift; my $usage = shift; + # make options bold my $trivial = $usage->{trivial}; $trivial =~s/(?/sxg; - - my $full = - join("\n", + my @f1; + my @f0 = map { $_ !~ /^\s/ && s/(?/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 =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 $ -- cgit v1.2.3-55-g6feb