Take me over?
NAME
Posy::Plugin::TextTemplate - Posy plugin for interpolating with Text::Template
VERSION
This describes version 0.40 of Posy::Plugin::TextTemplate.
SYNOPSIS
@plugins = qw(Posy::Core
Posy::Plugin::TextTemplate
...);
DESCRIPTION
This overrides Posy's simple interpolate() method, by using the Text::Template module. This is not compatible with core Posy style interpolation.
Note that, if you want access to any of posy's methods inside a template, the Posy object should be available through the variable "$Posy".
Configuration
This expects configuration settings in the $self->{config} hash, which, in the default Posy setup, can be defined in the main "config" file in the data directory.
- tt_recurse_into_entry
-
Do you want me to recursively interpolate into the entry $title and $body? Consider carefully before turning this on, since if anyone other than you has the ability to post entries, there is a chance of foolishness or malice, exposing variables and calling actions/subroutines you might not want called. (0 = No, 1 = Yes)
- tt_left_delim tt_right_delim
-
The delimiters to use for Text::Template; for the sake of speed, it is best not to use the original '{' '}' delimiters. (default: tt_left_delim='[==', tt_right_delim='==]')
- tt_entry_left_delim tt_entry_right_delim
-
The delimiters to use for Text::Template inside an entry (if tt_recurse_into_entry is true) (default: tt_entry_left_delim='<?perl' tt_entry_right_delim='perl?>')
I used these defaults because they look like XML directives, and for compatibility with teperl.
OBJECT METHODS
Documentation for developers and those wishing to write plugins.
init
Do some initialization; make sure that default config values are set.
Helper Methods
Methods which can be called from within other methods.
set_vars
my %vars = $self->set_vars($flow_state);
my %vars = $self->set_vars($flow_state, $current_entry, $entry_state);
Sets variable hashes to be used in interpolation of templates.
This can be called from a flow action or as an entry action, and will use the given state hashes accordingly.
interpolate
$content = $self->interpolate($chunk, $template, \%vars);
Interpolate the contents of the vars hash with the template and return the result.
REQUIRES
Posy
Posy::Core
Text::Template
Test::More
SEE ALSO
perl(1). Posy Text::Template
BUGS
Please report any bugs or feature requests to the author.
AUTHOR
Kathryn Andersen (RUBYKAT)
perlkat AT katspace dot com
http://www.katspace.com
COPYRIGHT AND LICENCE
Copyright (c) 2004-2005 by Kathryn Andersen
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.