.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Template::AutoFilter 3pm" .TH Template::AutoFilter 3pm "2021-01-06" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Template::AutoFilter \- Template::Toolkit with automatic filtering .SH "VERSION" .IX Header "VERSION" version 0.143050 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Template::AutoFilter; \& \& my $templ = "[% str %] [% str | none %] [% str | url %]"; \& \& my $out; \& Template::AutoFilter\->new\->process( \e$templ, { str => \*(Aq\*(Aq }, \e$out ); \& \& print $out; # "<a> %3Ca%3E" \& \& my $out; \& Template::AutoFilter\->new( AUTO_FILTER => \*(Aqupper\*(Aq )\->process( \e$templ, { str => \*(Aq\*(Aq }, \e$out ); \& \& print $out; # " %3Ca%3E" .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Template::AutoFilter is a subclass of Template::Toolkit which loads a specific Parser that is subclassed from Template::Parser. It adds a filter instruction to each interpolation token found in templates loaded by the \s-1TT\s0 engine. Tokens that already have a filter instruction are left unchanged. .PP By default this automatic filter is set to be 'html', but can be modified during object creation by passing the \s-1AUTO_FILTER\s0 option with the name of the wanted filter. .PP Additionally a pass-through filter called 'none' is added to the object to allow exclusion of tokens from being filtered. .PP Lastly, if you have problems with the directives which get auto filters applied, you can see the Template::AutoFilter::Parser docs for how you can customize that. .PP \&\s-1WARNING:\s0 This module is highly experimental. I have not done a lot of testing and things might blow up in unexpected ways. The \s-1API\s0 and behavior might change with any release (until 1.0). If you'd like to see any changes implemented, let me know via \s-1RT,\s0 email, \s-1IRC\s0 or by opening a pull request on github. .PP Use at your own risk. .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" Pre-processes the parameters passed on to Template's \fBnew()\fR. Adds the pass-through filter and creates the AutoFilter Parser. .PP All parameters passed to this \fBnew()\fR will also be passed to the parser's \&\fBnew()\fR. .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Ryan Olson (cpan:GIMPSON) .PP Aran Deltac (cpan:BLUEFEET) .PP Thomas Sibley (cpan:TSIBLEY) .SH "SUPPORT" .IX Header "SUPPORT" .SS "Bugs / Feature Requests" .IX Subsection "Bugs / Feature Requests" Please report any bugs or feature requests through the issue tracker at . You will be notified automatically of any progress on your issue. .SS "Source Code" .IX Subsection "Source Code" This is open source software. The code repository is available for public review and contribution under the terms of the license. .PP .PP .Vb 1 \& git clone https://github.com/wchristian/Template\-AutoFilter.git .Ve .SH "AUTHOR" .IX Header "AUTHOR" Christian Walde .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Christian Walde has dedicated the work to the Commons by waiving all of his or her rights to the work worldwide under copyright law and all related or neighboring legal rights he or she had in the work, to the extent allowable by law. .PP Works under \s-1CC0\s0 do not require attribution. When citing the work, you should not imply endorsement by the author.