Template::Plugin::Textile2 - Use Textile formatting with Template Toolkit
[% USE Textile2 -%] [% FILTER textile2 %]This *bold* and this is _italic_.[% END %] <p>this is <strong>bold</strong> and this is <em>italic</em>. [% USE Textile2 ( disable_html => 1 ) -%] [% FILTER textile2 %]this is<br /> _italic_.[% END %] <p>this is<br /> <em>italic</em>.</p>
This module wraps Text::Textile into a plugin Template Toolkit. It provides a filter named textile2. This aims to be a more feature-full version Template::Plugin::Textile, by allowing you to pass parameters to Text::Textile.
textile2
Use this way:
[% FILTER textile2 %] Reasons to use the Template Toolkit: * Seperation of concerns. * It's written in Perl. * Badgers are Still Cool. [% END %]
or:
[% mytext | textile2 %]
You can pass the same options you would pass to Text::Textile, directly when using the template. For instance to disable processing of HTML tags you can do:
[% USE Textile2 ( disable_html => 1 ) %]
To avoid your text to be wrapped into <p>...</p> you can use:
<p>...</p>
[% USE Textile2 ( format_mode => 'inline' ) %]
See Text::Textile for details.
Michele Beltrame mb@italpro.net.
mb@italpro.net
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Text::Textile, Template
To install Template::Plugin::Textile2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::Textile2
CPAN shell
perl -MCPAN -e shell install Template::Plugin::Textile2
For more information on module installation, please visit the detailed CPAN module installation guide.