Hi all,
I got bored of waiting for me to release TT3 so I back-ported "outline"
directives to TT2. This is only on github at the moment, not yet
released to CPAN.
Short example:
%% IF a
a is set to [% a %]
%% ELSE
a is not set
%% END
Which is equivalent to:
[% IF a -%]
a is set to [% a %]
[% ELSE -%]
a is not set
[% END -%]
Enable it by setting the TAG_STYLE option to 'outline':
my $tt = Template->new({
TAG_STYLE => 'outline',
});
Or by defining your own OUTLINE_TAG string:
my $tt = Template->new({
OUTLINE_TAG => '%%',
});
Or by using the TAGS directive to set the 'outline' style:
[% TAGS outline %]
Or to set the start, end and (optional) outline tags:
[% TAGS <* *> >> %]
See t/outline.t for tests:
https://github.com/abw/Template2/blob/master/t/outline.t
Changes to the relevant sections of the docs are here:
https://github.com/abw/Template2/commit/5622870ba1b7c6da3720c6b6cec29c0304ef3ce9#diff-6dd5714206375d47e8c26eb0fe6980a4R60
https://github.com/abw/Template2/commit/5622870ba1b7c6da3720c6b6cec29c0304ef3ce9#diff-65cc2456a43e5577bf3ac2a18eb43ebdR60
Comments, feedback, etc., welcome. Assuming I don't hear any reports of
mass breakage, I'll release this as version 2.26 in the next few days
(noting that I've also got two pull requests outstanding on github that
I need to look at first).
Cheers
Andy
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates