line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EPublisher::Target::Plugin::OTRSDoc; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Create HTML version of OTRS documentation |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1650
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
38
|
|
6
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
7
|
1
|
|
|
1
|
|
7
|
use File::Basename; |
|
1
|
|
|
|
|
11
|
|
|
1
|
|
|
|
|
113
|
|
8
|
1
|
|
|
1
|
|
7
|
use File::Path qw(make_path); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
96
|
|
9
|
1
|
|
|
1
|
|
1531
|
use HTML::Template::Compiled; |
|
1
|
|
|
|
|
136682
|
|
|
1
|
|
|
|
|
14
|
|
10
|
1
|
|
|
1
|
|
297839
|
use Pod::Simple::XHTML; |
|
1
|
|
|
|
|
61451
|
|
|
1
|
|
|
|
|
42
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
1077
|
use EPublisher; |
|
1
|
|
|
|
|
14954
|
|
|
1
|
|
|
|
|
119
|
|
13
|
1
|
|
|
1
|
|
927
|
use EPublisher::Target::Base; |
|
1
|
|
|
|
|
352
|
|
|
1
|
|
|
|
|
595
|
|
14
|
|
|
|
|
|
|
our @ISA = qw(EPublisher::Target::Base); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
our $VERSION = 0.4; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub deploy { |
19
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
0
|
|
|
|
my $pods = $self->_config->{source} || []; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
0
|
|
|
|
my $encoding = $self->_config->{encoding} || ':encoding(UTF-8)'; |
24
|
0
|
|
0
|
|
|
|
my $base_url = $self->_config->{base_url} || ''; |
25
|
0
|
|
|
|
|
|
my $version = 0; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
my @TOC = map{ |
28
|
0
|
|
|
|
|
|
(my $name = $_->{title}) =~ s/::/_/g; |
29
|
0
|
|
|
|
|
|
{ target => join( '/', $base_url, lc( $name ) . '.html'), name => $_->{title} }; |
30
|
0
|
|
|
|
|
|
} @{$pods}; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $output = $self->_config->{output}; |
33
|
0
|
0
|
0
|
|
|
|
make_path $output if $output && !-d $output; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
for my $pod ( @{$pods} ) { |
|
0
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
my $parser = Pod::Simple::XHTML->new; |
37
|
0
|
|
|
|
|
|
$parser->index(0); |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
(my $name = $pod->{title}) =~ s/::/_/g; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
$parser->output_string( \my $xhtml ); |
42
|
0
|
|
|
|
|
|
$parser->parse_string_document( $pod->{pod} ); |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $tmpl = HTML::Template::Compiled->new( |
45
|
|
|
|
|
|
|
filename => $self->_config->{template}, |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
$xhtml =~ s{ |