Module::Starter::Plugin::TT23pm
Tt2 templates for module::starter::template
Usage
use Module::Starter qw(Module::Starter::SimpleModule::Starter::Plugin::TemplateModule::Starter::Plugin::TT2...);Module::Starter->create_distro( ... );
Version
version 0.125
Overview
This Module::Starter plugin is intended to be loaded after Module::Starter::Plugin::Template. It implements the "renderer" and "render" methods, required by the Template plugin. The methods are implemented with Template Toolkit.
Examples
This module's distribution includes a directory, "templates/dir", and a file "templates/inline" that contain stock templates for use with the InlineStore and DirStore plugins. On Debian systems these files are installed in "/usr/share/doc/libmodule-starter-plugin-tt2-perl/examples". The module itself contains default templates for the ModuleStore plugin in its data section.
Usage
This module is meant to be used with the template stores in the SimpleStore distribution (although you could certainly write your own template store). If you only want to use the built-in templates, you could have lines like this in your config file ("~/.module-starter/config"):
author: Lord Poncembyemail: [email protected]plugins: Module::Starter::Simple Module::Starter::Plugin::TemplateModule::Starter::Plugin::ModuleStore Module::Starter::Plugin::TT2template_module: Module::Starter::Plugin::TT2
(Where the plugins line is one line.) This tells Module::Starter to look for the templates in the data section of Module::Starter::Plugin::TT2, which isn't very interesting, since you'll end up getting the same effect as if you'd just used Module::Starter without plugins.
To override this behavior, you'd instruct Module::Starter to look somewhere else, either by changing the "template_module" setting, changing the MODULE_TEMPLATE_MODULE environment variable, or using a different template store altogether (q.v., SimpleStore or other plugins).
If you need to send parameters to the Template constructor, put them in the "template_parms" parameter to the "create_distro" method. It must be a hash reference.
Methods
"renderer"
As implemented, this method just creates a new Template Toolkit engine and stores it in the Module::Starter object.
"render( $template, \%options )"
This method passes the given template contents and options to the TT2 renderer and returns the resulting document.
Releases
7 releases since Debian 7 (Wheezy); the text changed 3 times.