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