File Coverage

blib/lib/Pod/Tree/HTML/LinkMap.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 0 2 0.0
total 27 29 93.1


line stmt bran cond sub pod time code
1             package Pod::Tree::HTML::LinkMap;
2 13     13   8911723 use 5.006;
  13         42  
3 13     13   75 use strict;
  13         27  
  13         254  
4 13     13   55 use warnings;
  13         21  
  13         2656  
5              
6             our $VERSION = '1.29';
7              
8             sub new {
9 60     60 0 96 my $class = shift;
10 60         330 bless {}, $class;
11             }
12              
13             sub url {
14 156     156 0 231 my ( $link_map, $html, $target ) = @_;
15              
16 156         221 my $depth = $html->{options}{depth};
17 156         244 my $base = join '/', ('..') x $depth;
18              
19 156         289 my $page = $target->get_page;
20 156         247 $page =~ s(::)(/)g;
21 156 100       290 $page .= '.html' if $page;
22              
23 156         267 my $section = $target->get_section;
24 156         300 my $fragment = $html->escape_2396($section);
25              
26 156         348 my $url = $html->assemble_url( $base, $page, $fragment );
27 156         312 $url;
28             }
29              
30             1;