| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Template::Caribou::Tags::HTML; |
|
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
|
3
|
|
|
|
|
|
|
# ABSTRACT: Basic HTML tag library |
|
4
|
|
|
|
|
|
|
$Template::Caribou::Tags::HTML::VERSION = '1.2.1'; |
|
5
|
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
15521
|
use strict; |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
73
|
|
|
7
|
3
|
|
|
3
|
|
9
|
use warnings; |
|
|
3
|
|
|
|
|
4
|
|
|
|
3
|
|
|
|
|
65
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
353
|
use parent 'Exporter::Tiny'; |
|
|
3
|
|
|
|
|
199
|
|
|
|
3
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @EXPORT; |
|
12
|
|
|
|
|
|
|
our @UNFORMATED_TAGS; |
|
13
|
|
|
|
|
|
|
our @FORMATED_TAGS; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
BEGIN { |
|
16
|
3
|
|
|
3
|
|
2869
|
@UNFORMATED_TAGS = qw/ i emphasis b strong span small sup /; |
|
17
|
3
|
|
|
|
|
121
|
@FORMATED_TAGS = qw/ |
|
18
|
|
|
|
|
|
|
p html head h1 h2 h3 h4 h5 h6 body div |
|
19
|
|
|
|
|
|
|
style title li ol ul a |
|
20
|
|
|
|
|
|
|
label link img section article |
|
21
|
|
|
|
|
|
|
table thead tbody th td |
|
22
|
|
|
|
|
|
|
fieldset legend form input select option button |
|
23
|
|
|
|
|
|
|
textarea |
|
24
|
|
|
|
|
|
|
/; |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
BEGIN { |
|
28
|
|
|
|
|
|
|
|
|
29
|
3
|
|
|
3
|
|
31
|
@EXPORT = @Template::Caribou::Tags::HTML::TAGS = ( @UNFORMATED_TAGS, @FORMATED_TAGS ); |
|
30
|
3
|
|
|
|
|
178
|
push @EXPORT, 'table_row'; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
use Template::Caribou::Tags |
|
34
|
|
|
|
|
|
|
mytag => { -as => 'table_row', tag => 'tr' }, |
|
35
|
105
|
|
|
|
|
148
|
( map { ( mytag => { -as => $_, tag => $_ } ) } @FORMATED_TAGS ), |
|
36
|
3
|
|
|
3
|
|
394
|
( map { ( mytag => { -as => $_, tag => $_, indent => 0 } ) } @UNFORMATED_TAGS ); |
|
|
3
|
|
|
|
|
5
|
|
|
|
3
|
|
|
|
|
14
|
|
|
|
21
|
|
|
|
|
68
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=pod |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=encoding UTF-8 |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Template::Caribou::Tags::HTML - Basic HTML tag library |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 VERSION |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
version 1.2.1 |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package MyTemplate; |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
use Template::Caribou; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
use Template::Caribou::Tags::HTML; |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
template main => sub { |
|
63
|
|
|
|
|
|
|
html { |
|
64
|
|
|
|
|
|
|
head { title { "Website X" } }; |
|
65
|
|
|
|
|
|
|
body { |
|
66
|
|
|
|
|
|
|
h1 { "Some Title" }; |
|
67
|
|
|
|
|
|
|
div { |
|
68
|
|
|
|
|
|
|
"Blah blah"; |
|
69
|
|
|
|
|
|
|
}; |
|
70
|
|
|
|
|
|
|
}; |
|
71
|
|
|
|
|
|
|
}; |
|
72
|
|
|
|
|
|
|
}; |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Exports tag blocks for regular HTML tags. |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 TAG FUNCTIONS EXPORTED |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
p html head h1 h2 h3 h4 h5 h6 body emphasis div sup style title span li ol ul i b strong a label link img section article table thead tbody th td table_row fieldset legend form input select option button small textarea |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
All function names are the same than their tag name, except for C<table_row>, which is for C<tr> (which is an already taken Perl keyword). |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 AUTHOR |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Yanick Champoux. |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
93
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=cut |