package ActivePerl::DocTools::TOC::HTML;
our $VERSION = '0.01';
use strict;
use warnings;
use base ('ActivePerl::DocTools::TOC');
my $indent = ' ' x 4;
# constructs the simpler methods
sub text {
my ($text) = join '', map { "$_\n" } @_;
return sub { $text };
}
# extra info is tedious to collect -- is done in a subclass or something.
sub extra { '' };
*header = text ("
Core Perl Documentation
","
");
sub before_pods { '' }
*pod_separator = text('
');
sub pod {
my ($self, $file) = @_;
return _page($self->{'podz'}->{"Pod::$file"}, $file, $self->extra($file));
}
sub after_pods { '' }
*before_pragmas = text("Pragmas
","
");
sub pragma {
my ($self, $file) = @_;
return _page($self->{'pragmaz'}->{$file}, $file, $self->extra($file));
}
sub after_pragmas { '' }
*before_libraries = text( "Modules
","
");
*library_indent_open = sub {''}; # text('');
*library_indent_close = sub {''}; # text('
');
*library_indent_same = sub {''};
sub library {
my ($self, $file, $showfile, $depth) = @_;
return (($indent x $depth) . _page($self->{'filez'}->{$file}, $showfile, $self->extra($file)));
}
sub library_container {
my ($self, $file, $showfile, $depth) = @_;
return (($indent x $depth) . _folder($showfile));
}
sub after_libraries { '' }
*footer = text("