line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Pod::POM::View::Confluence; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
122198
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
79
|
|
4
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
68
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# most of the code below and until __END__ |
7
|
|
|
|
|
|
|
# was lifted from Pod::POM::View::Text |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
1169
|
use Pod::POM::View; |
|
2
|
|
|
|
|
1027
|
|
|
2
|
|
|
|
|
61
|
|
10
|
2
|
|
|
2
|
|
15
|
use base qw( Pod::POM::View ); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
233
|
|
11
|
2
|
|
|
2
|
|
12
|
use vars qw( $VERSION $DEBUG $ERROR $AUTOLOAD $INDENT ); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
181
|
|
12
|
2
|
|
|
2
|
|
3271
|
use Text::Wrap; |
|
2
|
|
|
|
|
9019
|
|
|
2
|
|
|
|
|
3207
|
|
13
|
|
|
|
|
|
|
$VERSION = '0.01'; |
14
|
|
|
|
|
|
|
$DEBUG = 0 unless defined $DEBUG; |
15
|
|
|
|
|
|
|
$INDENT = 0; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub new { |
19
|
0
|
|
|
0
|
1
|
0
|
my $class = shift; |
20
|
0
|
0
|
|
|
|
0
|
my $args = ref $_[0] eq 'HASH' ? shift : { @_ }; |
21
|
0
|
|
|
|
|
0
|
bless { |
22
|
|
|
|
|
|
|
INDENT => 0, |
23
|
|
|
|
|
|
|
%$args, |
24
|
|
|
|
|
|
|
}, $class; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub view { |
29
|
140
|
|
|
140
|
1
|
41456
|
my ($self, $type, $item) = @_; |
30
|
|
|
|
|
|
|
|
31
|
140
|
100
|
|
|
|
571
|
if ($type =~ s/^seq_//) { |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
32
|
124
|
|
|
|
|
576
|
return $item; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
elsif (UNIVERSAL::isa($item, 'HASH')) { |
35
|
16
|
50
|
|
|
|
41
|
if (defined $item->{ content }) { |
|
|
0
|
|
|
|
|
|
36
|
16
|
|
|
|
|
66
|
return $item->{ content }->present($self); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
elsif (defined $item->{ text }) { |
39
|
0
|
|
|
|
|
0
|
my $text = $item->{ text }; |
40
|
0
|
0
|
|
|
|
0
|
return ref $text ? $text->present($self) : $text; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
else { |
43
|
0
|
|
|
|
|
0
|
return ''; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
elsif (! ref $item) { |
47
|
0
|
|
|
|
|
0
|
return $item; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
else { |
50
|
0
|
|
|
|
|
0
|
return ''; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub view_head1 { |
56
|
13
|
|
|
13
|
0
|
326
|
my ($self, $head1) = @_; |
57
|
13
|
|
|
|
|
76
|
my $title = $head1->title->present($self); |
58
|
|
|
|
|
|
|
|
59
|
13
|
|
|
|
|
147
|
my $output = "h1. $title\n" . $head1->content->present($self); |
60
|
13
|
|
|
|
|
116
|
return $output; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub view_head2 { |
65
|
3
|
|
|
3
|
0
|
89
|
my ($self, $head2) = @_; |
66
|
3
|
|
|
|
|
19
|
my $title = $head2->title->present($self); |
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
|
|
33
|
my $output = "h2. $title\n" . $head2->content->present($self); |
69
|
|
|
|
|
|
|
|
70
|
3
|
|
|
|
|
52
|
return $output; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub view_head3 { |
75
|
1
|
|
|
1
|
0
|
30
|
my ($self, $head3) = @_; |
76
|
1
|
|
|
|
|
11
|
my $title = $head3->title->present($self); |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
15
|
my $output = "h3. $title\n" . $head3->content->present($self); |
79
|
|
|
|
|
|
|
|
80
|
1
|
|
|
|
|
21
|
return $output; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub view_head4 { |
85
|
1
|
|
|
1
|
0
|
34
|
my ($self, $head4) = @_; |
86
|
1
|
|
|
|
|
32
|
my $title = $head4->title->present($self); |
87
|
|
|
|
|
|
|
|
88
|
1
|
|
|
|
|
14
|
my $output = "h4. $title\n" . $head4->content->present($self); |
89
|
|
|
|
|
|
|
|
90
|
1
|
|
|
|
|
4
|
return $output; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub view_item { |
95
|
15
|
|
|
15
|
0
|
320
|
my ($self, $item) = @_; |
96
|
15
|
50
|
|
|
|
34
|
my $indent = ref $self ? \$self->{ INDENT } : \$INDENT; |
97
|
15
|
|
|
|
|
26
|
my $pad = '*' x $$indent; |
98
|
15
|
|
|
|
|
293
|
my $title = $item->title->present($self); |
99
|
15
|
|
|
|
|
122
|
$title =~ s/^\s*\*/'*'x($$indent+1)/e; |
|
10
|
|
|
|
|
32
|
|
100
|
15
|
|
|
|
|
37
|
$title =~ s/^\s*\d+/'#'x($$indent+1)/e; |
|
2
|
|
|
|
|
142
|
|
101
|
15
|
|
|
|
|
25
|
$$indent += 1; |
102
|
15
|
|
|
|
|
86
|
my $content = $item->content->present($self); |
103
|
15
|
|
|
|
|
124
|
$content =~ s/^\s+//; |
104
|
15
|
|
|
|
|
40
|
$content =~ s/\n+/\n/g; |
105
|
15
|
|
|
|
|
26
|
$$indent -= 1; |
106
|
|
|
|
|
|
|
|
107
|
15
|
|
|
|
|
37
|
$content =~ s/\n+\z//g; |
108
|
15
|
|
|
|
|
64
|
return "$title $content\n"; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub view_for { |
113
|
2
|
|
|
2
|
0
|
58
|
my ($self, $for) = @_; |
114
|
2
|
100
|
|
|
|
20
|
return '' unless $for->format() =~ /\bconfluence\b/; |
115
|
1
|
|
|
|
|
25
|
return $for->text() |
116
|
|
|
|
|
|
|
. "\n"; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub view_begin { |
121
|
2
|
|
|
2
|
0
|
55
|
my ($self, $begin) = @_; |
122
|
2
|
100
|
|
|
|
20
|
return '' unless $begin->format() =~ /\bconfluence\b/; |
123
|
1
|
|
|
|
|
25
|
return $begin->content->present($self); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub view_textblock { |
128
|
37
|
|
|
37
|
0
|
742
|
my ($self, $text) = @_; |
129
|
37
|
|
|
|
|
251
|
$text =~ s/\s+/ /mg; |
130
|
37
|
|
|
|
|
121
|
$text =~ s/\s+\z//; |
131
|
37
|
|
|
|
|
195
|
return $text . "\n"; |
132
|
|
|
|
|
|
|
} |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
sub view_verbatim { |
136
|
3
|
|
|
3
|
0
|
52
|
my ($self, $text) = @_; |
137
|
3
|
|
|
|
|
18
|
return "{noformat}\n$text\n{noformat}\n"; |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub view_seq_bold { |
142
|
1
|
|
|
1
|
0
|
12
|
my ($self, $text) = @_; |
143
|
1
|
|
|
|
|
6
|
return "*$text*"; |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
sub view_seq_italic { |
148
|
6
|
|
|
6
|
0
|
57
|
my ($self, $text) = @_; |
149
|
6
|
|
|
|
|
24
|
return "_${text}_"; |
150
|
|
|
|
|
|
|
} |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
sub view_seq_code { |
154
|
10
|
|
|
10
|
0
|
83
|
my ($self, $text) = @_; |
155
|
10
|
|
|
|
|
44
|
return "{{$text}}"; |
156
|
|
|
|
|
|
|
} |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
sub view_seq_file { |
160
|
1
|
|
|
1
|
0
|
43
|
my ($self, $text) = @_; |
161
|
1
|
|
|
|
|
6
|
return "_${text}_"; |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
my $entities = { |
165
|
|
|
|
|
|
|
gt => '>', |
166
|
|
|
|
|
|
|
lt => '<', |
167
|
|
|
|
|
|
|
amp => '&', |
168
|
|
|
|
|
|
|
quot => '"', |
169
|
|
|
|
|
|
|
}; |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
sub view_seq_entity { |
173
|
4
|
|
|
4
|
0
|
41
|
my ($self, $entity) = @_; |
174
|
4
|
|
100
|
|
|
31
|
return $entities->{ $entity } || $entity; |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
sub view_seq_link { |
178
|
11
|
|
|
11
|
0
|
99
|
my ($self, $link) = @_; |
179
|
11
|
|
|
|
|
50
|
return "[$link]"; |
180
|
|
|
|
|
|
|
} |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
1; |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
__END__ |