summaryrefslogtreecommitdiff
path: root/pod/buildtoc
diff options
context:
space:
mode:
Diffstat (limited to 'pod/buildtoc')
-rw-r--r--pod/buildtoc25
1 files changed, 20 insertions, 5 deletions
diff --git a/pod/buildtoc b/pod/buildtoc
index 41cb76dcb5..8192b5bd3d 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -114,6 +114,8 @@ podset( @modules[ sort { $modname[$a] cmp $modname[$b] } 0 .. $#modules ] );
Here should be listed all the extra programs' documentation, but they
don't all have manual pages yet:
+ =over
+
=item a2p
=item s2p
@@ -132,6 +134,7 @@ podset( @modules[ sort { $modname[$a] cmp $modname[$b] } 0 .. $#modules ] );
=item wrapsuid
+ =back
=head1 AUTHOR
@@ -150,8 +153,7 @@ sub podset {
while(<>) {
if (s/^=head1 (NAME)\s*/=head2 /) {
$pod = path2modname($ARGV);
- unitem();
- unhead2();
+ unhead1();
output "\n \n\n=head2 ";
$_ = <>;
if ( /^\s*$pod\b/ ) {
@@ -164,7 +166,9 @@ sub podset {
next;
}
if (s/^=head1 (.*)/=item $1/) {
- unitem(); unhead2();
+ unhead2();
+ output "=over\n\n" unless $inhead1;
+ $inhead1 = 1;
output $_; nl(); next;
}
if (s/^=head2 (.*)/=item $1/) {
@@ -172,7 +176,6 @@ sub podset {
output "=over\n\n" unless $inhead2;
$inhead2 = 1;
output $_; nl(); next;
-
}
if (s/^=item ([^=].*)\n/$1/) {
next if $pod eq 'perldiag';
@@ -188,6 +191,10 @@ sub podset {
s/^-X\b/-I<X>/;
output $_; next;
}
+ if (s/^=cut\s*\n//) {
+ unhead1();
+ next;
+ }
}
}
@@ -200,12 +207,20 @@ sub path2modname {
return $_;
}
+sub unhead1 {
+ unhead2();
+ if ($inhead1) {
+ output "\n\n=back\n\n";
+ }
+ $inhead1 = 0;
+}
+
sub unhead2 {
+ unitem();
if ($inhead2) {
output "\n\n=back\n\n";
}
$inhead2 = 0;
- $initem = 0;
}
sub unitem {