Pandoc...ifilter(3pm)

πŸ“¦
version 0.38 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Pandoc::Filter::Multifilter β€” the Pandoc...ifilter(3pm) page, bestie edition πŸ¦‹

okay so this is a Perl module page, it's 3pm, it lives in the User Contributed Perl Documentation, and it's literally all about one little filter that reads its instructions straight out of your metadata. iconic behavior tbh πŸ‘‘


✨ NAME ✨

Pandoc::Filter::Multifilter β€” applies filters from the metadata field "multifilter" πŸ’…


🌸 DESCRIPTION 🌸

so this filter ships as a system-wide executable called multifilter. that's the whole vibe. πŸ‘€

and like β€” if you want the actual documentation, go read the docs over there at multifilter, because this page is not the one doing the heavy lifting. no cap. 🫢


πŸŽ€ METHODS πŸŽ€

new

creates a brand new multifilter. fresh out the box, sparkling, ready to go ✨

apply( $doc [, $format [, $metadata ] ] )

applies every single filter that's listed in the document metadata field "metafilters". all of them. the whole squad. πŸ”₯


🌈 FUNCTIONS 🌈

find_filter( $name [, $DATADIR ] )

this one goes hunting for a filter by its name πŸ” and it looks in two places:

  • inside "$DATADIR/filters" β€” where $DATADIR is your user data directory, aka .pandoc in ~ or %appdata%\pandoc
  • and in your $PATH 🌟

what does it give you back? a list of command line arguments you'd use to execute that filter πŸ’« …or it throws an exception, if it's feeling dramatic 😭

apply_filter( $doc, $format, @filter )

this one takes a filter β€” handed to it as its command line arguments β€” and applies it to a Pandoc Document element πŸ“„βž‘οΈπŸ“„. you get back a transformed Document, or it throws an exception on error πŸ’€

and you can call it like this, fr fr:

apply_filter( $doc, $format, find_filter( $name ) );

lowkey a tiny module, highkey doing the most 🧚

and that's the whole page, bestie! this was perl v5.38.2, dated 2024-08-03, and the manual is Pandoc...ifilter(3pm) β€” mwah, slay, periodt πŸ’…πŸ’œ

πŸ“¦ where this page comes from