5 use base 'Pod::Simple::XHTML';
8 my $self = shift->SUPER::new(@_);
10 $self->anchor_items(1);
14 sub perldoc_url_prefix { "http://metacpan.org/module/" }
16 sub html_header { '' }
19 my $toc = "../" x ($self->batch_mode_current_level - 1);
20 return '<a href="./' . $toc . '">← Back to index</a>';
23 sub start_Verbatim { $_[0]{'scratch'} = "<pre>" }
24 sub end_Verbatim { $_[0]{'scratch'} .= "</pre>"; $_[0]->emit; }
28 $self->{scratch} = '<a href="#___top">' . $self->{scratch} . '</a>';
29 return $self->SUPER::_end_head(@_);
32 sub resolve_pod_page_link {
34 my ($name, $section) = @_;
36 # Only try to resolve local links if we're in batch mode and are linking
37 # outside the current document.
38 return $self->SUPER::resolve_pod_page_link(@_)
39 unless $self->batch_mode and $name;
41 $section = defined $section
42 ? '#' . $self->idify($section, 1)
46 if ($name =~ /^RT::/) {
48 map { $self->encode_entities($_) }
51 elsif ($name =~ /^rt-/) {
52 $local = $self->encode_entities($name);
56 # Resolve links correctly by going up
57 my $depth = $self->batch_mode_current_level - 1;
59 ($depth ? ".." x $depth : ()),
60 "$local.html$section";
62 return $self->SUPER::resolve_pod_page_link(@_)