diff --git a/Changes b/Changes index 3944e48..a53b1cd 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Mojolicious::Plugin::TtRenderer {{$NEXT}} + - documentation 1.47 2013-07-26 06:07:35 America/New_York - Template-Toolkit 2.25 compatability diff --git a/README.pod b/README.pod index 227077a..c40a100 100644 --- a/README.pod +++ b/README.pod @@ -2,7 +2,7 @@ =head1 NAME -Mojolicious::Plugin::TtRenderer - Template Renderer Plugin +Mojolicious::Plugin::TtRenderer - Template Renderer Plugin for Mojolicious =head1 VERSION @@ -10,21 +10,131 @@ version 1.47 =head1 SYNOPSIS - # Mojolicious - $self->plugin('tt_renderer'); - $self->plugin(tt_renderer => {template_options => {FILTERS => [ ... ]}}); +L example: - # Mojolicious::Lite + use Mojolicious::Lite; + + # Documentation browser under "/perldoc" plugin 'tt_renderer'; - plugin tt_renderer => {template_options => {FILTERS => [ ... ]}}; + + get '/' => sub { + my $self = shift; + $self->render('index'); + }; + + app->start; + + __DATA__ + + @@ index.html.tt + [% + WRAPPER 'layouts/default.html.tt' + title = 'default' + %] +

Welcome to the Mojolicious real-time web framework!

+

Welcome to the TtRenderer plugin!

+ [% END %] + + @@ layouts/default.html.tt + + + [% title %] + [% content %] + =head1 DESCRIPTION -L is a simple loader for -L. +This plugin is a simple Template Toolkit renderer for L. +Its defaults are usually reasonable, although for finer grain detail in +configuration you may want to use +L directly. =encoding utf-8 +=head1 OPTIONS + +These are the options that can be passed in as arguments to this plugin. + +=head2 template_options + +Configuration hash passed into L