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   9105727 use 5.006;
  13         55  
3 13     13   74 use strict;
  13         48  
  13         420  
4 13     13   85 use warnings;
  13         34  
  13         3135  
5              
6             our $VERSION = '1.30';
7              
8             sub new {
9 60     60 0 127 my $class = shift;
10 60         356 bless {}, $class;
11             }
12              
13             sub url {
14 156     156 0 306 my ( $link_map, $html, $target ) = @_;
15              
16 156         247 my $depth = $html->{options}{depth};
17 156         324 my $base = join '/', ('..') x $depth;
18              
19 156         367 my $page = $target->get_page;
20 156         318 $page =~ s(::)(/)g;
21 156 100       336 $page .= '.html' if $page;
22              
23 156         339 my $section = $target->get_section;
24 156         368 my $fragment = $html->escape_2396($section);
25              
26 156         392 my $url = $html->assemble_url( $base, $page, $fragment );
27 156         398 $url;
28             }
29              
30             1;