DSL-HTML
view release on metacpan or search on metacpan
lib/DSL/HTML/Compiler.pm view on Meta::CPAN
use warnings;
use utf8;
use DSL::HTML;
template foo {
tag head {
tag title {
text q'foo';
}
css q'b.css';
js q'a.js';
}
tag div('class' => q'bar baz', 'id' => q'foo') {
text q' xxx ';
}
tag p {
text q' yyyy ';
tag div('class' => q'bar baz', 'id' => q'foo') {
text q' xxx ';
}
}
}
1;
Delimiter for qX...X is chosen via a fall-through (see C<delimiters>)
=head1 DELIMITERS
Delimiter is chosen from this list, the first delimiter not found in the string
being quoted is used. If no valid delimiter can be found then an exception is
thrown.
=over 4
=item '
=item "
=item `
=item /
=item |
=item :
=item ~
=item !
=item -
=item â
This one is unicode
=item a..z A..Z
If all else fails try a-z and A-Z.
=back
=head1 EXPORTS
=over 4
=item my $perl_code = compile_from_html( $name, $html )
Build perl code from html text.
=item my $perl_code = compile_from_file( $name, $file )
Build perl code from an html file.
=back
=head1 AUTHORS
Chad Granum L<exodist7@gmail.com>
=head1 COPYRIGHT
Copyright (C) 2013 Chad Granum
DSL-HTML is free software; Standard perl license (GPL and Artistic).
DSL-HTML is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
( run in 0.964 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )