char vs U8 warnings
[p5sagit/p5-mst-13.2.git] / pod / buildtoc
index da45856..f158cba 100644 (file)
@@ -5,11 +5,16 @@ use Text::Wrap;
 sub output ($);
 
 @pods = qw(
-           perl perlnews perldata perlsyn perlop perlre perlrun perlfunc
-           perlvar perlsub perlmod perlform perllocale perlref perldsc
-           perllol perltoot perlobj perltie perlbot perlipc perldebug
-           perldiag perlsec perltrap perlstyle perlpod perlbook
-           perlembed perlapio perlxs perlxstut perlguts perlcall
+          perl perlfaq perlfaq1 perlfaq2 perlfaq3 perlfaq4 perlfaq5
+          perlfaq6 perlfaq7 perlfaq8 perlfaq9 perldelta perldata
+          perlsyn perlop perlre perlrun perlfunc perlvar perlsub
+          perlmod perlmodlib perlmodinstall perlfork perlform perllocale 
+          perlref perlreftut perldsc
+          perllol perltoot perltootc perlobj perltie perlbot perlipc
+          perldbmfilter perldebug
+          perldiag perlsec perltrap perlport perlstyle perlpod perlbook
+          perlembed perlapio perlxs perlxstut perlguts perlcall perlcompile
+          perlapi perlintern perlhist
          );
 
 for (@pods) { s/$/.pod/ }
@@ -109,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
@@ -127,10 +134,11 @@ podset( @modules[ sort { $modname[$a] cmp $modname[$b] } 0 .. $#modules ] );
 
        =item wrapsuid
 
+       =back
 
        =head1 AUTHOR
 
-       Larry Wall E<lt>F<larry\@wall.org>E<gt>, with the help of oodles
+       Larry Wall <F<larry\@wall.org>>, with the help of oodles
        of other folks.
 
 
@@ -145,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/ ) {
@@ -159,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/) {
@@ -167,15 +176,14 @@ sub podset {
            output "=over\n\n" unless $inhead2;
            $inhead2 = 1;
            output $_; nl(); next;
-
        }
-       if (s/^=item (.*)\n/$1/) {
+       if (s/^=item ([^=].*)\n/$1/) {
            next if $pod eq 'perldiag';
            s/^\s*\*\s*$// && next;
            s/^\s*\*\s*//;
            s/\s+$//;
            next if /^[\d.]+$/;
-           next if $pod eq 'perlmod' && /^ftp:/;
+           next if $pod eq 'perlmodlib' && /^ftp:/;
            ##print "=over\n\n" unless $initem;
            output ", " if $initem;
            $initem = 1;
@@ -183,6 +191,10 @@ sub podset {
            s/^-X\b/-I<X>/;
            output $_; next;
        }
+       if (s/^=cut\s*\n//) {
+           unhead1();
+           next;
+       }
     }
 }
 
@@ -195,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 {