Templa...Parser(3pm)
π Template::AutoFilter::Parser π
okay bestie, come SIT. this is Template::AutoFilter::Parser, and she's a lil Perl module from the User Contributed Perl Documentation corner of the 3pm man pages. the vibe? she parses your TT templates and automatically slaps filters onto tokens so you don't have to do it by hand like some kind of Victorian orphan. no cap. π
β¨ VERSION β¨
version 0.143050</pη΄«θ²>
(yeah she's on 0.143050, write it down, don't be that girl)
π¦ DESCRIPTION π¦
so basically? she's a sub-class of Template::Parser. that's it. that's the whole vibe. she inherits everything and then adds her own lil flourishes. it's giving "raised by a very respectable parent but she has her own thing going on". π
πΈ METHODS πΈ
okay so for most of the methods you should go look at Template::Parser, because she's not gonna re-explain her whole family tree. what's documented here is just the extra stuff β the added methods. the bonus tracks. the deluxe edition. β¨
π new π
new takes all the standard Template::Parser parameters, plus a couple extra ones that are honestly iconic:
AUTO_FILTERβ takes a single string, and that string is the name of the filter that gets applied to <em>every</em> directive that's been left off the skip list. she defaults to'html', which likeβ¦ yeah, makes sense, html filter is the moment. πSKIP_DIRECTIVESβ this one lets you customize whichTemplate::Manual::Directivesget exempted from having auto filters applied. she expects an array ref of strings. and the default value? it's whatever$self->default_skip_directiveshands back. so like, she's self-referential and confident. we love that for her. π«Ά
π§ split_text π§
split_text changes up the token processing by adding the filter you named in AUTO_FILTER to all the filter-less interpolation tokens. so if a token was just sitting there naked with no filter on? not anymore. she's dressing it. π
β has_skip_field β
has_skip_field looks at the field list of a token and checks whether it's holding directives that should be excluded from filtering. like a bouncer at the door of the filter club. π«
π default_skip_directives π
default_skip_directives hands you back a reference to a hash stuffed with the default directives that get excluded. the default value is literally this, no edits:
CALL SET DEFAULT INCLUDE PROCESS WRAPPER BLOCK IF UNLESS ELSIF ELSE
END SWITCH CASE FOREACH FOR WHILE FILTER USE MACRO TRY CATCH FINAL
THROW NEXT LAST RETURN STOP CLEAR META TAGS DEBUG
that's the whole list bestie. all of them. every single one made it in. π
π make_skip_directives π
make_skip_directives prebuilds a hash of the directives that should be skipped while you're applying auto filters. it's the "get your ducks in a row before the party starts" method. proactive queen. π¦
π AUTHOR π
Christian Walde <walde.christian@gmail.com>
(he made this. show some respect. π )
π 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.
okay important part, listen up: works under CC0 do not require attribution. so you literally don't have to credit anyone. but if you do cite the work, you should not imply endorsement by the author. do not put words in her mouth. π
perl v5.36.0 Β· 2022-11-19 β and that's the sign-off bestie, the source and version and date all wrapped up like a lil gift. this page was brought to you by Templa...Parser(3pm), she ate and left no crumbs. bye pookie πβ¨π
π¦ where this page comes from
- debian bookworm: libtemplate-autofilter-perl 0.143050-3 Β· CC0-1.0
- debian trixie: libtemplate-autofilter-perl 0.143050-3 Β· CC0-1.0
- ubuntu noble: libtemplate-autofilter-perl 0.143050-3 Β· CC0-1.0
- ubuntu resolute: libtemplate-autofilter-perl 0.143050-3 Β· CC0-1.0
- ubuntu stonking: libtemplate-autofilter-perl 0.143050-3 Β· CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms