Template::Caribou::Tags::HTML::Extended - custom HTML tags optimized for DWIMery
version 0.2.4
package MyTemplate; use Moose; use Template::Caribou::Tags::HTML; use Template::Caribou::Tags::HTML::Extended; with 'Template::Caribou'; template 'page' => sub { html { head { css q{ color: magenta; }; }; body { markdown q{Ain't Markdown **grand**?}; anchor "http://foo.com" => sub { image 'http://foo.com/bar.jpg', alt => 'Foo logo'; }; } } };
Template::Caribou::Tags::HTML::Extended provides utility tags that provides shortcuts for typical HTML constructs.
Prints the doctype declaration for the given type.
For the moment, only html 5 is supported as a type.
Generates the favicon tag.
favicon 'my_icon.png';
will generates
<link rel="shortcut icon" href="my_icon.png" />
Shortcut for
input { attr type => submit, value => 'value', %attr; }
If you don't want value to be passed, the first argument might be set to undef.
Compile the LESS script into CSS.
<script type="text/javascript>$script</script>
<script type="text/javascript" src="http://..."> </script>
Wraps the $text in a style element.
<style type="text/css">$text</style>
Shortcut for <a>. $inner can be either a string, or a subref.
anchor 'http://foo.com' => 'linkie';
is equivalent to
a { attr href => 'http://foo.com'; 'linkie'; }
Shortcut for <img>.
Converts the markdown $text into its html equivalent.
Uses Text::MultiMarkdown.
Yanick Champoux <yanick@cpan.org>
This software is copyright (c) 2014 by Yanick Champoux.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Template::Caribou, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Caribou
CPAN shell
perl -MCPAN -e shell install Template::Caribou
For more information on module installation, please visit the detailed CPAN module installation guide.