line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Auto::Templates; |
2
|
2
|
|
|
2
|
|
12
|
use base qw/Template::Provider/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
191
|
|
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
62
|
|
5
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
9
|
use File::Basename; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
619
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
HTML::Auto::Templates - this module stores HTML::Auto templates |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Version 0.02 |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $VERSION = '0.06'; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $templates = { |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
'matrix' => <<'EOT' |
24
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
| |
110
|
|
|
|
|
|
|
[% FOREACH i IN cols %] |
111
|
|
|
|
|
|
|
| [% i -%] |
112
|
|
|
|
|
|
|
[% END %] |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
[% i_c = 0 %] |
115
|
|
|
|
|
|
|
[% FOREACH i IN vals %] |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
| [% lines.shift -%] |
118
|
|
|
|
|
|
|
[% j_c = 0 %] |
119
|
|
|
|
|
|
|
[% FOREACH j IN i %] |
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
[% class = "" %] |
122
|
|
|
|
|
|
|
[% IF i_c == j_c %] |
123
|
|
|
|
|
|
|
[% class = "mid" %] |
124
|
|
|
|
|
|
|
[% END %] |
125
|
|
|
|
|
|
|
[% IF more.$i_c.$j_c %] |
126
|
|
|
|
|
|
|
[% class = "more_info " _ class %] |
127
|
|
|
|
|
|
|
[% END %] |
128
|
|
|
|
|
|
|
[% IF attrs.$i_c.$j_c.class %] |
129
|
|
|
|
|
|
|
[% class = class _ " " _ attrs.$i_c.$j_c.class %] |
130
|
|
|
|
|
|
|
[% END %] |
131
|
|
|
|
|
|
|
[% attrs.$i_c.$j_c.delete('class') %] |
132
|
|
|
|
|
|
|
[% IF class.length != 0 %] |
133
|
|
|
|
|
|
|
class="[% class %]" |
134
|
|
|
|
|
|
|
[% END %] |
135
|
|
|
|
|
|
|
[% FOREACH att IN attrs.$i_c.$j_c.keys %] |
136
|
|
|
|
|
|
|
[% att %]="[% attrs.$i_c.$j_c.$att %]" |
137
|
|
|
|
|
|
|
[% END %] |
138
|
|
|
|
|
|
|
>[% j %] |
139
|
|
|
|
|
|
|
[% IF more.$i_c.$j_c %] |
140
|
|
|
|
|
|
|
[% more.$i_c.$j_c %] |
141
|
|
|
|
|
|
|
[% END %] |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
[% j_c = j_c + 1 %] |
144
|
|
|
|
|
|
|
[% END %] |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
[% i_c = i_c + 1 %] |
147
|
|
|
|
|
|
|
[% END %] |
148
|
|
|
|
|
|
|
| |
149
|
|
|
|
|
|
|
EOT |
150
|
|
|
|
|
|
|
, |
151
|
|
|
|
|
|
|
'h' => <<'EOT' |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
[% FOREACH i IN list %] |
154
|
|
|
|
|
|
|
[% i %] |
155
|
|
|
|
|
|
|
[% END %] |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
EOT |
159
|
|
|
|
|
|
|
, |
160
|
|
|
|
|
|
|
'v' => <<'EOT' |
161
|
|
|
|
|
|
|
[% FOREACH i IN list %] |
162
|
|
|
|
|
|
|
[% i %] |
163
|
|
|
|
|
|
|
[% END %] |
164
|
|
|
|
|
|
|
EOT |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
}; |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head2 _template_modified |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
TODO |
171
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=cut |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
sub _template_modified { |
175
|
8
|
|
|
8
|
|
110591
|
my($self,$path) = @_; |
176
|
|
|
|
|
|
|
|
177
|
8
|
|
|
|
|
24
|
return 1; |
178
|
|
|
|
|
|
|
} |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=head2 _template_content |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
TODO |
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=cut |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
sub _template_content { |
187
|
4
|
|
|
4
|
|
23
|
my ($self, $path) = @_; |
188
|
|
|
|
|
|
|
|
189
|
4
|
|
|
|
|
183
|
$path = basename($path);; |
190
|
4
|
50
|
|
|
|
18
|
$self->debug("get $path") if $self->{DEBUG}; |
191
|
|
|
|
|
|
|
|
192
|
4
|
|
|
|
|
12
|
my $data = $templates->{$path}; |
193
|
4
|
|
|
|
|
10
|
my $error = "error: $path not found"; |
194
|
4
|
|
|
|
|
6
|
my $mod_date = 1; |
195
|
|
|
|
|
|
|
|
196
|
4
|
|
|
|
|
18
|
return $data; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=head1 AUTHOR |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
Nuno Carvalho, C<< >> |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head1 BUGS |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
207
|
|
|
|
|
|
|
the web interface at L. I will be notified, and then you'll |
208
|
|
|
|
|
|
|
automatically be notified of progress on your bug as I make changes. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=head1 SUPPORT |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
perldoc HTML::Auto |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
You can also look for information at: |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=over 4 |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
L |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
L |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=item * CPAN Ratings |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
L |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=item * Search CPAN |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
L |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=back |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
Copyright 2012 Project Natura. |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
251
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
252
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
255
|
|
|
|
|
|
|
|
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
=cut |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
1; # End of HTML::Auto |