next if /^\#/;
# At least one upper case letter somewhere in the first group
- if (/^(\S+)\s(.*)/ && $1 =~ tr/A-Z//) {
+ if (/^(\S+)\s(.*)/ && $1 =~ tr/h//) {
# it's a heading
my $flags = $1;
+ $flags =~ tr/h//d;
my %flags = (header => 1);
- $flags{toc_omit} = 1 if $flags =~ tr/O//d;
- $flags{include} = 1 if $flags =~ tr/I//d;
- $flags{aux} = 1 if $flags =~ tr/A//d;
+ $flags{toc_omit} = 1 if $flags =~ tr/o//d;
+ $flags{aux} = 1 if $flags =~ tr/a//d;
die "$0: Unknown flag found in heading line: $_" if length $flags;
push @Master, [\%flags, $2];
return if $file =~ m!lib/Math/BigInt/t/!;
return if $file =~ m!/Devel/PPPort/[Hh]arness|lib/Devel/Harness!i;
return if $file =~ m!XS/(?:APItest|Typemap)!;
+ my $pod = $file;
+ return if $pod =~ s/pm$/pod/ && -e $pod;
die "$0: tut $File::Find::name" if $file =~ /TUT/;
unless (open (F, "< $_\0")) {
warn "$0: bogus <$file>: $!";
sub output_perltoc {
open(OUT, ">perltoc.pod") || die "$0: creating perltoc.pod failed: $!";
- $/ = '';
+ local $/ = '';
($_= <<"EOPOD2B") =~ s/^\t//gm && output($_);
+ # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+ # This file is autogenerated by buildtoc from all the other pods.
+ # Edit those files and run buildtoc --build-toc to effect changes.
+
=head1 NAME
perltoc - perl documentation table of contents
my $pod;
while(<>) {
+ tr/\015//d;
if (s/^=head1 (NAME)\s*/=head2 /) {
$pod = path2modname($ARGV);
unhead1();
}
sub generate_descrip_mms_2 {
- map {sprintf <<'SNIP', $_, $_}
-[.lib.pod]%s.pod : [.pod]%s.pod
+ map {sprintf <<'SNIP', $_, $_ eq 'perlvms' ? 'vms' : 'pod', $_}
+[.lib.pod]%s.pod : [.%s]%s.pod
@ If F$Search("[.lib]pod.dir").eqs."" Then Create/Directory [.lib.pod]
Copy/NoConfirm/Log $(MMS$SOURCE) [.lib.pod]
SNIP
# Dictionary order - fold and handle non-word chars as nothing
map { $_->[0] }
sort { $a->[1] cmp $b->[1] || $a->[0] cmp $b->[0] }
- map { my $f = $_; $f =~ s/[^a-z\s]//g; [ $_, $f ] }
+ map { my $f = lc $_; $f =~ s/[^a-z0-9\s]//g; [ $_, $f ] }
@manifest,
&generate_manifest_pod(),
&generate_manifest_readme();
sub do_podmak {
my $name = shift;
my $body = join '', @_;
- foreach my $variable qw(pod man html tex) {
+ foreach my $variable (qw(pod man html tex)) {
die "$0: could not find $variable in $name"
unless $body =~ s{\n\U$variable\E = (?:[^\n]*\\\n)*[^\n]*}
{"\n" . generate_pod_mak ($variable)}se;
next unless $Build{$target};
$built++;
if ($target eq "toc") {
+ print "Now processing $name\n" if $Verbose;
&output_perltoc;
+ print "Finished\n" if $Verbose;
next;
}
print "Now processing $name\n" if $Verbose;