line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyrights 2003-2015 by [Mark Overmeer]. |
2
|
|
|
|
|
|
|
# For other contributors see ChangeLog. |
3
|
|
|
|
|
|
|
# See the manual pages for details on the licensing terms. |
4
|
|
|
|
|
|
|
# Pod stripped from pm file by OODoc 2.01. |
5
|
1
|
|
|
1
|
|
945
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package OODoc::Format::Pod3; |
9
|
1
|
|
|
1
|
|
5
|
use vars '$VERSION'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
10
|
|
|
|
|
|
|
$VERSION = '2.01'; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
4
|
use base 'OODoc::Format::Pod'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
81
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
5
|
use Log::Report 'oodoc'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
272
|
use OODoc::Template (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
21
|
|
17
|
1
|
|
|
1
|
|
9
|
use List::Util qw/first/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
1565
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $default_template; |
21
|
|
|
|
|
|
|
{ local $/; |
22
|
|
|
|
|
|
|
$default_template = ; |
23
|
|
|
|
|
|
|
close DATA; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub createManual(@) |
27
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
28
|
0
|
|
0
|
|
|
|
$self->{O_template} = delete $args{template} || \$default_template; |
29
|
0
|
|
|
|
|
|
$self->SUPER::createManual(%args); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub formatManual(@) |
33
|
0
|
|
|
0
|
1
|
|
{ my ($self, %args) = @_; |
34
|
0
|
|
|
|
|
|
my $output = delete $args{output}; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
my $template = OODoc::Template->new |
37
|
|
|
|
|
|
|
( markers => [ '<{', '}>' ] |
38
|
|
|
|
|
|
|
, manual_obj => delete $args{manual} |
39
|
0
|
|
|
|
|
|
, chapter_order => |
40
|
|
|
|
|
|
|
[ qw/NAME INHERITANCE SYNOPSIS DESCRIPTION OVERLOADED METHODS |
41
|
|
|
|
|
|
|
FUNCTIONS CONSTANTS EXPORTS DIAGNOSTICS DETAILS REFERENCES |
42
|
|
|
|
|
|
|
COPYRIGHTS/ |
43
|
|
|
|
|
|
|
] |
44
|
|
|
|
|
|
|
, %args |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
$output->print |
48
|
|
|
|
|
|
|
( scalar $template->process |
49
|
|
|
|
|
|
|
( $self->{O_template} |
50
|
0
|
|
|
0
|
|
|
, manual => sub { shift; ( {}, @_ ) } |
|
0
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
|
|
, chapters => sub { $self->chapters($template, @_) } |
52
|
0
|
|
|
0
|
|
|
, sections => sub { $self->sections($template, @_) } |
53
|
0
|
|
|
0
|
|
|
, subsections => sub { $self->subsections($template, @_) } |
54
|
0
|
|
|
0
|
|
|
, subsubsections => sub { $self->subsubsections($template, @_) } |
55
|
0
|
|
|
0
|
|
|
, subroutines => sub { $self->subroutines($template, @_) } |
56
|
0
|
|
|
0
|
|
|
, diagnostics => sub { $self->diagnostics($template, @_) } |
57
|
|
|
|
|
|
|
) |
58
|
0
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub structure($$$) |
63
|
0
|
|
|
0
|
0
|
|
{ my ($self, $template, $type, $object) = @_; |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
my $manual = $template->valueFor('manual_obj'); |
66
|
0
|
|
|
|
|
|
my $descr = $self->cleanup($manual, $object->description); |
67
|
0
|
|
|
|
|
|
my $name = $object->name; |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
0
|
|
|
|
$descr =~ s/\n*$/\n\n/ |
70
|
|
|
|
|
|
|
if defined $descr && length $descr; |
71
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
my @examples = $object->examples; |
73
|
0
|
|
|
|
|
|
my @extends; |
74
|
|
|
|
|
|
|
|
75
|
0
|
0
|
0
|
|
|
|
unless($name eq 'NAME' || $name eq 'SYNOPSIS') |
76
|
0
|
|
|
|
|
|
{ @extends = map +{manual => $_->manual, header => $name} |
77
|
|
|
|
|
|
|
, $object->extends; |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
+{ $type => $name |
81
|
|
|
|
|
|
|
, $type.'_obj' => $object |
82
|
|
|
|
|
|
|
, description => $descr |
83
|
|
|
|
|
|
|
, examples => \@examples |
84
|
|
|
|
|
|
|
, extends => \@extends |
85
|
|
|
|
|
|
|
}; |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub chapters($$$$$) |
89
|
0
|
|
|
0
|
0
|
|
{ my ($self, $template, $tag, $attrs, $then, $else) = @_; |
90
|
0
|
|
|
|
|
|
my $manual = $template->valueFor('manual_obj'); |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
my @chapters |
93
|
0
|
|
|
|
|
|
= map $self->structure($template, chapter => $_) |
94
|
|
|
|
|
|
|
, $manual->chapters; |
95
|
|
|
|
|
|
|
|
96
|
0
|
0
|
|
|
|
|
if(my $order = $attrs->{order}) |
97
|
0
|
0
|
|
|
|
|
{ my @order = ref $order eq 'ARRAY' ? @$order : split( /\,\s*/, $order); |
98
|
0
|
|
|
|
|
|
my %order; |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# first the pre-defined names, then the other |
101
|
0
|
|
|
|
|
|
my $count = 1; |
102
|
0
|
|
|
|
|
|
$order{$_} = $count++ for @order; |
103
|
0
|
|
0
|
|
|
|
$order{$_->{chapter}} ||= $count++ for @chapters; |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
@chapters = sort { $order{$a->{chapter}} <=> $order{$b->{chapter}} } |
|
0
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
@chapters; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
( \@chapters, $attrs, $then, $else ); |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub sections($$$$$) |
113
|
0
|
|
|
0
|
0
|
|
{ my ($self, $template, $tag, $attrs, $then, $else) = @_; |
114
|
0
|
|
|
|
|
|
my $chapter = $template->valueFor('chapter_obj'); |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
return ([], $attrs, $then, $else) |
117
|
0
|
0
|
|
0
|
|
|
unless first {!$_->isEmpty} $chapter->sections; |
|
0
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
my @sections |
120
|
0
|
|
|
|
|
|
= map { $self->structure($template, section => $_) } |
|
0
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
$chapter->sections; |
122
|
|
|
|
|
|
|
|
123
|
0
|
|
|
|
|
|
( \@sections, $attrs, $then, $else ); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub subsections($$$$$) |
127
|
0
|
|
|
0
|
0
|
|
{ my ($self, $template, $tag, $attrs, $then, $else) = @_; |
128
|
0
|
|
|
|
|
|
my $section = $template->valueFor('section_obj'); |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
return ([], $attrs, $then, $else) |
131
|
0
|
0
|
|
0
|
|
|
unless first {!$_->isEmpty} $section->subsections; |
|
0
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
my @subsections |
134
|
0
|
|
|
|
|
|
= map { $self->structure($template, subsection => $_) } |
|
0
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
$section->subsections; |
136
|
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
( \@subsections, $attrs, $then, $else ); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
sub subsubsections($$$$$) |
141
|
0
|
|
|
0
|
0
|
|
{ my ($self, $template, $tag, $attrs, $then, $else) = @_; |
142
|
0
|
|
|
|
|
|
my $subsection = $template->valueFor('subsection_obj'); |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
return ([], $attrs, $then, $else) |
145
|
0
|
0
|
|
0
|
|
|
unless first {!$_->isEmpty} $subsection->subsubsections; |
|
0
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
my @subsubsections |
148
|
0
|
|
|
|
|
|
= map { $self->structure($template, subsubsection => $_) } |
|
0
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
$subsection->subsubsections; |
150
|
|
|
|
|
|
|
|
151
|
0
|
|
|
|
|
|
( \@subsubsections, $attrs, $then, $else ); |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
sub subroutines($$$$$$) |
155
|
0
|
|
|
0
|
1
|
|
{ my ($self, $template, $tag, $attrs, $then, $else) = @_; |
156
|
|
|
|
|
|
|
|
157
|
0
|
|
0
|
|
|
|
my $parent |
158
|
|
|
|
|
|
|
= $template->valueFor('subsubsection_obj') |
159
|
|
|
|
|
|
|
|| $template->valueFor('subsection_obj') |
160
|
|
|
|
|
|
|
|| $template->valueFor('section_obj') |
161
|
|
|
|
|
|
|
|| $template->valueFor('chapter_obj'); |
162
|
|
|
|
|
|
|
|
163
|
0
|
0
|
|
|
|
|
defined $parent |
164
|
|
|
|
|
|
|
or return (); |
165
|
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
my $out = ''; |
167
|
0
|
|
|
|
|
|
open OUT, '>',\$out; |
168
|
|
|
|
|
|
|
|
169
|
0
|
|
|
|
|
|
my @show = map +($_ => scalar $template->valueFor($_)), |
170
|
|
|
|
|
|
|
qw/show_described_options show_described_subs show_diagnostics |
171
|
|
|
|
|
|
|
show_examples show_inherited_options show_inherited_subs |
172
|
|
|
|
|
|
|
show_option_table show_subs_index/; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# This is quite weak: the whole POD section for a sub description |
175
|
|
|
|
|
|
|
# is produced outside the template. In the future, this may get |
176
|
|
|
|
|
|
|
# changed: if there is a need for it: of course, we can do everything |
177
|
|
|
|
|
|
|
# in the template system. |
178
|
|
|
|
|
|
|
|
179
|
0
|
|
|
|
|
|
$self->showSubroutines |
180
|
|
|
|
|
|
|
( subroutines => [ $parent->subroutines ] |
181
|
|
|
|
|
|
|
, manual => $parent->manual |
182
|
|
|
|
|
|
|
, output => \*OUT |
183
|
|
|
|
|
|
|
, @show |
184
|
|
|
|
|
|
|
); |
185
|
|
|
|
|
|
|
|
186
|
0
|
|
|
|
|
|
close OUT; |
187
|
0
|
0
|
|
|
|
|
length $out or return; |
188
|
|
|
|
|
|
|
|
189
|
0
|
|
|
|
|
|
$out =~ s/\n*$/\n\n/; |
190
|
0
|
|
|
|
|
|
($out); |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
sub diagnostics($$$$$$) |
194
|
0
|
|
|
0
|
0
|
|
{ my ($self, $template, $tag, $attrs, $then, $else) = @_; |
195
|
0
|
|
|
|
|
|
my $manual = $template->valueFor('manual_obj'); |
196
|
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
|
my $out = ''; |
198
|
0
|
|
|
|
|
|
open OUT, '>',\$out; |
199
|
0
|
|
|
|
|
|
$self->chapterDiagnostics(%$attrs, manual => $manual, output => \*OUT); |
200
|
0
|
|
|
|
|
|
close OUT; |
201
|
|
|
|
|
|
|
|
202
|
0
|
|
|
|
|
|
$out =~ s/\n*$/\n\n/; |
203
|
0
|
|
|
|
|
|
($out); |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
1; |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
__DATA__ |