File Coverage

blib/lib/Pod/CYOA/XHTML.pm
Criterion Covered Total %
statement 12 15 80.0
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 23 73.9


line stmt bran cond sub pod time code
1 1     1   611 use strict;
  1         2  
  1         33  
2 1     1   5 use warnings;
  1         2  
  1         54  
3             package Pod::CYOA::XHTML 0.003;
4 1     1   563 use Pod::Simple::XHTML 3.13;
  1         39778  
  1         42  
5 1     1   9 use base 'Pod::Simple::XHTML';
  1         3  
  1         214  
6             # ABSTRACT: private Pod::Simple::XHTML subclass for CYOA
7              
8             #pod =head1 OVERVIEW
9             #pod
10             #pod Pod::CYOA::HTML is a private class whose interface should not yet be relied
11             #pod upon.
12             #pod
13             #pod It transforms Pod to HTML, with one important change: links with targets that
14             #pod begin with C<@> become links to relative html documents. In other words,
15             #pod C<< LE<lt>the start page|@startE<gt> >> becomes a link to C<start.html> rather
16             #pod than the "start" section of the current page.
17             #pod
18             #pod =cut
19              
20             sub resolve_pod_page_link {
21 0     0 1   my ($self, $to, $section) = @_;
22              
23 0 0         return $self->SUPER::resolve_pod_page_link($to, $section) if $to !~ s/^\@//;
24              
25 0           return "$to.html";
26             }
27              
28             1;
29              
30             __END__
31              
32             =pod
33              
34             =encoding UTF-8
35              
36             =head1 NAME
37              
38             Pod::CYOA::XHTML - private Pod::Simple::XHTML subclass for CYOA
39              
40             =head1 VERSION
41              
42             version 0.003
43              
44             =head1 OVERVIEW
45              
46             Pod::CYOA::HTML is a private class whose interface should not yet be relied
47             upon.
48              
49             It transforms Pod to HTML, with one important change: links with targets that
50             begin with C<@> become links to relative html documents. In other words,
51             C<< LE<lt>the start page|@startE<gt> >> becomes a link to C<start.html> rather
52             than the "start" section of the current page.
53              
54             =head1 PERL VERSION
55              
56             This module should work on any version of perl still receiving updates from
57             the Perl 5 Porters. This means it should work on any version of perl released
58             in the last two to three years. (That is, if the most recently released
59             version is v5.40, then this module should work on both v5.40 and v5.38.)
60              
61             Although it may work on older versions of perl, no guarantee is made that the
62             minimum required version will not be increased. The version may be increased
63             for any reason, and there is no promise that patches will be accepted to lower
64             the minimum required perl.
65              
66             =head1 AUTHOR
67              
68             Ricardo SIGNES <rjbs@semiotic.systems>
69              
70             =head1 COPYRIGHT AND LICENSE
71              
72             This software is copyright (c) 2021 by Ricardo SIGNES.
73              
74             This is free software; you can redistribute it and/or modify it under
75             the same terms as the Perl 5 programming language system itself.
76              
77             =cut