Commit 369be0bc authored by gregor herrmann's avatar gregor herrmann

[svn-upgrade] new version libtemplate-declare-perl (0.45)

parent bf3ea4cf
0.45 2011-04-15
* Added new HTML 5 elements to the HTML Tag set. (Theory)
0.44 2010-12-08
* Added support for $TAG_INDENTATION and $EOL (Marc Chantreux)
* Add a current_base_path() convenience function (trs)
......
......@@ -28,4 +28,4 @@ requires:
perl: 5.8.2
resources:
license: http://dev.perl.org/licenses/
version: 0.44
version: 0.45
......@@ -14,10 +14,10 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
SHA1 bea50ba2a1ec3c02864b92948ab28c1b525646ae Changes
SHA1 229e9d22495ced90449f67a93df813c185250269 Changes
SHA1 8da2ce69008bcb411301caba38aeed06d94aff41 MANIFEST
SHA1 6c79a8c5140fc8b0146fbc8f77acc613797eeb6f MANIFEST.SKIP
SHA1 d39dd57d522a3fbbc56a138af2a7bf1d0c81aced META.yml
SHA1 9c889d95945f64dd7d159944d21d3b2760390046 META.yml
SHA1 ee899bc436e17646223925d431d3e9727c1254d1 Makefile.PL
SHA1 6b14974531d0b5bfad494febf88d6e43f1a1de12 README
SHA1 20c73697e1713638140c719d8eaa19a275ed43a5 inc/Module/AutoInstall.pm
......@@ -31,14 +31,14 @@ SHA1 b721c93ca5bc9a6aa863b49af15f1b1de6125935 inc/Module/Install/Makefile.pm
SHA1 026cc0551a0ad399d195e395b46bdf842e115192 inc/Module/Install/Metadata.pm
SHA1 5457015ea5a50e93465bf2dafa29feebd547f85b inc/Module/Install/Win32.pm
SHA1 051e7fa8063908befa3440508d0584a2497b97db inc/Module/Install/WriteAll.pm
SHA1 32b5a4c5a0f15af69f1a2bc1066f5f604502b241 lib/Template/Declare.pm
SHA1 abce91386f0010f7d0a21ae294dbc479826e498f lib/Template/Declare.pm
SHA1 4202a05659532bea1d800bc7296d9c1312624f9b lib/Template/Declare/Buffer.pm
SHA1 c86b1e4749f76137c854358f496e8a8030d39fe7 lib/Template/Declare/TagSet.pm
SHA1 bd39d582e69e0725124a0ffcee10c5d12a2377b3 lib/Template/Declare/TagSet/HTML.pm
SHA1 3db3c3d4ecf402d8309014d2bb703eddeb100846 lib/Template/Declare/TagSet/HTML.pm
SHA1 c1703c1f999d27878117e0aaf59dcae1d9d98645 lib/Template/Declare/TagSet/RDF.pm
SHA1 8ba58a5c640010febb799bb03b7857eda34c86bc lib/Template/Declare/TagSet/RDF/EM.pm
SHA1 2941a453d2627e0c0c02b8f50e7600c648867831 lib/Template/Declare/TagSet/XUL.pm
SHA1 63cf6e9db9d122f0714589ae20869fa968e11f3c lib/Template/Declare/Tags.pm
SHA1 e58cac12b1f429e78723c147090746841b3a3065 lib/Template/Declare/Tags.pm
SHA1 f01b9a79b8f508729ce33693f0bb58d9cce54a3f t/99-pod-coverage.t
SHA1 332d20b7b38fc5728b89d46b80f5b4e9e0ce4e29 t/99-pod.t
SHA1 8de6d59c7ed7c771f9cdc5e2dbaef0c31c7ab439 t/MyTagSet.pm
......@@ -81,7 +81,7 @@ SHA1 b4e187860320bbcdffa8036a76b47752521fb1ff t/strict.t
SHA1 5a4d6002efea9daf71d3d291bf2a35751a51cba8 t/subclassing.t
SHA1 679b39abb4812ca1c61ad9e9dd3f5aab97f8829c t/subtemplates.t
SHA1 44f81200ec38ebf8bc9c836e34942f70990e7207 t/tag_sub_list.t
SHA1 706c1919716723253eb62dc79b094dd48b7815ad t/tagset_html.t
SHA1 72fcdef5a4a16376dcb45b858864652a44287d17 t/tagset_html.t
SHA1 17263784a1a80112896cd157de834709a387fbff t/tagset_mix.t
SHA1 cb48ee69151cf5b07ef19f4b2c727cb5580b1471 t/tagset_rdf.t
SHA1 d6b90c5e540749b6f2b7ffa9f6ae84838a234503 t/tagset_rdf_em.t
......@@ -94,7 +94,7 @@ SHA1 7bdcccbdd5253f4eae12d3c279183e10577a0184 t/xss.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
iEYEARECAAYFAkz/2UAACgkQsxfQtHhyRPoQkQCfXdF9WZ19xP9Gf0aT4WMN6gnP
+UwAniwBytP+w9P9gy9zFEC6R5eFRr8+
=jHQM
iEYEARECAAYFAk2oi4UACgkQsxfQtHhyRPqOVwCeOT81Lxrg0OW20K9UtKZldRBR
eWoAnixLN/tIa5iKIlMojG9YqAWsERyG
=bSv7
-----END PGP SIGNATURE-----
......@@ -7,7 +7,7 @@ use Template::Declare::Buffer;
use Class::ISA;
use String::BufferStack;
our $VERSION = '0.44';
our $VERSION = '0.45';
use base 'Class::Data::Inheritable';
__PACKAGE__->mk_classdata('dispatch_to');
......
......@@ -10,6 +10,7 @@ our %AlternateSpelling = (
td => 'cell',
base => 'html_base',
q => 'quote',
time => 'datetime',
);
sub get_alternate_spelling {
......@@ -40,7 +41,9 @@ sub get_tag_list {
radio_group popup_menu button autoescape scrolling_list image_button
start_form end_form startform endform start_multipart_form
end_multipart_form isindex tmpfilename uploadinfo url_encoded
multipart form canvas
multipart form canvas section article aside hgroup header footer nav
figure figcaption video audio embed mark progress meter time ruby rt
rp bdi wbr command details datalist keygen output
)]
}
......@@ -117,259 +120,311 @@ Template::Declare::TagSet::HTML. Here is the complete list:
=over
=item C<h1>
=item * C<h1>
=item C<h2>
=item * C<h2>
=item C<h3>
=item * C<h3>
=item C<h4>
=item * C<h4>
=item C<h5>
=item * C<h5>
=item C<h6>
=item * C<h6>
=item C<p>
=item * C<p>
=item C<br>
=item * C<br>
=item C<hr>
=item * C<hr>
=item C<ol>
=item * C<ol>
=item C<ul>
=item * C<ul>
=item C<li>
=item * C<li>
=item C<dl>
=item * C<dl>
=item C<dt>
=item * C<dt>
=item C<dd>
=item * C<dd>
=item C<menu>
=item * C<menu>
=item C<code>
=item * C<code>
=item C<var>
=item * C<var>
=item C<strong>
=item * C<strong>
=item C<em>
=item * C<em>
=item C<tt>
=item * C<tt>
=item C<u>
=item * C<u>
=item C<i>
=item * C<i>
=item C<b>
=item * C<b>
=item C<blockquote>
=item * C<blockquote>
=item C<pre>
=item * C<pre>
=item C<img>
=item * C<img>
=item C<a>
=item * C<a>
=item C<address>
=item * C<address>
=item C<cite>
=item * C<cite>
=item C<samp>
=item * C<samp>
=item C<dfn>
=item * C<dfn>
=item C<html>
=item * C<html>
=item C<head>
=item * C<head>
=item C<base>
=item * C<base>
=item C<body>
=item * C<body>
=item C<link>
=item * C<link>
=item C<nextid>
=item * C<nextid>
=item C<title>
=item * C<title>
=item C<meta>
=item * C<meta>
=item C<kbd>
=item * C<kbd>
=item C<start_html>
=item * C<start_html>
=item C<end_html>
=item * C<end_html>
=item C<input>
=item * C<input>
=item C<select>
=item * C<select>
=item C<option>
=item * C<option>
=item C<comment>
=item * C<comment>
=item C<charset>
=item * C<charset>
=item C<escapehtml>
=item * C<escapehtml>
=item C<div>
=item * C<div>
=item C<table>
=item * C<table>
=item C<caption>
=item * C<caption>
=item C<th>
=item * C<th>
=item C<td>
=item * C<td>
=item C<tr>
=item * C<tr>
=item C<tr>
=item * C<tr>
=item C<sup>
=item * C<sup>
=item C<sub>
=item * C<sub>
=item C<strike>
=item * C<strike>
=item C<applet>
=item * C<applet>
=item C<param>
=item * C<param>
=item C<nobr>
=item * C<nobr>
=item C<embed>
=item * C<embed>
=item C<basefont>
=item * C<basefont>
=item C<style>
=item * C<style>
=item C<span>
=item * C<span>
=item C<layer>
=item * C<layer>
=item C<ilayer>
=item * C<ilayer>
=item C<font>
=item * C<font>
=item C<frameset>
=item * C<frameset>
=item C<frame>
=item * C<frame>
=item C<script>
=item * C<script>
=item C<small>
=item * C<small>
=item C<big>
=item * C<big>
=item C<area>
=item * C<area>
=item C<map>
=item * C<map>
=item C<abbr>
=item * C<abbr>
=item C<acronym>
=item * C<acronym>
=item C<bdo>
=item * C<bdo>
=item C<col>
=item * C<col>
=item C<colgroup>
=item * C<colgroup>
=item C<del>
=item * C<del>
=item C<fieldset>
=item * C<fieldset>
=item C<iframe>
=item * C<iframe>
=item C<ins>
=item * C<ins>
=item C<label>
=item * C<label>
=item C<legend>
=item * C<legend>
=item C<noframes>
=item * C<noframes>
=item C<noscript>
=item * C<noscript>
=item C<object>
=item * C<object>
=item C<optgroup>
=item * C<optgroup>
=item C<q>
=item * C<q>
=item C<thead>
=item * C<thead>
=item C<tbody>
=item * C<tbody>
=item C<tfoot>
=item * C<tfoot>
=item C<blink>
=item * C<blink>
=item C<fontsize>
=item * C<fontsize>
=item C<center>
=item * C<center>
=item C<textfield>
=item * C<textfield>
=item C<textarea>
=item * C<textarea>
=item C<filefield>
=item * C<filefield>
=item C<password_field>
=item * C<password_field>
=item C<hidden>
=item * C<hidden>
=item C<checkbox>
=item * C<checkbox>
=item C<checkbox_group>
=item * C<checkbox_group>
=item C<submit>
=item * C<submit>
=item C<reset>
=item * C<reset>
=item C<defaults>
=item * C<defaults>
=item C<radio_group>
=item * C<radio_group>
=item C<popup_menu>
=item * C<popup_menu>
=item C<button>
=item * C<button>
=item C<autoescape>
=item * C<autoescape>
=item C<scrolling_list>
=item * C<scrolling_list>
=item C<image_button>
=item * C<image_button>
=item C<start_form>
=item * C<start_form>
=item C<end_form>
=item * C<end_form>
=item C<startform>
=item * C<startform>
=item C<endform>
=item * C<endform>
=item C<start_multipart_form>
=item * C<start_multipart_form>
=item C<end_multipart_form>
=item * C<end_multipart_form>
=item C<isindex>
=item * C<isindex>
=item C<tmpfilename>
=item * C<tmpfilename>
=item C<uploadinfo>
=item * C<uploadinfo>
=item C<url_encoded>
=item * C<url_encoded>
=item C<multipart>
=item * C<multipart>
=item C<form>
=item * C<form>
=item C<canvas>
=item * C<canvas>
=item * C<section>
=item * C<article>
=item * C<aside>
=item * C<hgroup>
=item * C<header>
=item * C<footer>
=item * C<nav>
=item * C<figure>
=item * C<figcaption>
=item * C<video>
=item * C<audio>
=item * C<embed>
=item * C<mark>
=item * C<progress>
=item * C<meter>
=item * C<time>
=item * C<ruby>
=item * C<rt>
=item * C<rp>
=item * C<bdi>
=item * C<wbr>
=item * C<command>
=item * C<details>
=item * C<datalist>
=item * C<keygen>
=item * C<output>
=back
......@@ -378,10 +433,11 @@ Template::Declare::TagSet::HTML. Here is the complete list:
$bool = $obj->get_alternate_spelling($tag);
Returns the alternative spelling for a given tag if any or undef otherwise.
Currently, C<tr> is mapped to C<row>, C<td> is mapped to C<cell>, and C<base>
is mapped to C<html_base>. These alternates are to avoid conflicts with the
Perl operator C<tr> and the L<base|base> module, with C<td> changed so as to
keep consistent with table rows.
Currently, C<tr> is mapped to C<row>, C<td> is mapped to C<cell>, C<q> is
mapped to C<quote>, C<base> is mapped to C<html_base>, and C<time> is mapped
to C<datetime>. These alternates are to avoid conflicts with the Perl C<tr>
and C<q> operators, the C<time> function, and the L<base|base> module, with
C<td> changed so as to keep consistent with table rows.
=head2 can_combine_empty_tags( TAG )
......@@ -392,25 +448,25 @@ C<< <tag /> >>. Currently, only a few HTML tags are allowed to be combined:
=over
=item C<base>
=item * C<base>
=item C<meta>
=item * C<meta>
=item C<link>
=item * C<link>
=item C<hr>
=item * C<hr>
=item C<br>
=item * C<br>
=item C<param>
=item * C<param>
=item C<img>
=item * C<img>
=item C<area>
=item * C<area>
=item C<input>
=item * C<input>
=item C<col>
=item * C<col>
=back
......
......@@ -528,7 +528,7 @@ sub install_tag {
);
### Exporting place-holder sub: $name
# XXX TODO: more checking here
if ($name !~ /^(?:base|tr)$/) {
if ($name !~ /^(?:base|tr|time)$/) {
push @EXPORT, $name;
push @TAG_SUB_LIST, $name;
}
......
......@@ -5,14 +5,19 @@ package MyApp::Templates;
use base 'Template::Declare';
use Template::Declare::Tags qw/ HTML /;
my $time;
template main => sub {
$time = time;
caption { attr { id => 'a' } }
link {};
table {
row {
cell { "Hello, world!" }
}
};
row {
cell { datetime { $time } };
};
}
img { attr { src => 'cat.gif' } }
label {}
......@@ -38,6 +43,11 @@ is $out, <<_EOC_;
<tr>
<td>Hello, world!</td>
</tr>
<tr>
<td>
<time>$time</time>
</td>
</tr>
</table>
<img src="cat.gif" />
<label></label>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment