package ActivePerl::DocTools::TOC::HTML;
use strict;
use warnings;
use base 'ActivePerl::DocTools::TOC';
sub text {
my $text = join("\n", @_, "");
return sub { $text };
}
# extra info is tedious to collect -- is done in a subclass or something.
sub extra { '' };
*header = text ("","
","Perl Core Documentation","",);
# pod
sub before_pods { '' }
*pod_separator = text('
');
sub pod {
my($self, $file) = @_;
my $key = $^O eq "darwin" ? "pods::$file" : "Pod::$file";
$key = "pods::$file" if $^O eq "MSWin32" && Win32::BuildNumber() >= 821;
return (qq' - ' . _page($self->{pods}->{$key}, $file, $self->extra($file)));
}
sub after_pods { '
' }
# scripts
*before_scripts = text("
","Programs
","",);
sub script {
my($self, $file) = @_;
return (qq' - ' . _page($self->{scripts}->{$file}, $file, $self->extra($file)));
}
sub after_scripts { '
' }
# pragmas
*before_pragmas = text("
","Pragmas
","",);
sub pragma {
my($self, $file) = @_;
return (qq' - ' . _page($self->{pragmas}->{$file}, $file, $self->extra($file)));
}
sub after_pragmas { '
' }
# libraries
*before_libraries = text("
","Modules
","",);
sub library_indent_open { '' } # text('');
sub library_indent_close { '' } # text('
');
sub library_indent_same { '' }
sub library {
my($self, $file, $showfile, $depth) = @_;
return (qq' - ' . _page($self->{files}->{$file}, $showfile, $self->extra($file)));
}
sub library_container {
my($self, $file, $showfile, $depth) = @_;
return qq(
- $showfile
\n);
}
sub after_libraries { '
' }
*footer = text("\n\n\n