Templa...Parser(3pm)

πŸ“¦
version 0.143050 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 which Template::Manual::Directives get exempted from having auto filters applied. she expects an array ref of strings. and the default value? it's whatever $self->default_skip_directives hands 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. πŸ’…)


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 πŸ’–βœ¨πŸŽ€