Wiki::...ltiple(3pm)
Okay bestie, welcome to the Wiki::Toolkit::Formatter::Multiple manual page (the 3pm one, header shorthand Wiki::...ltiple(3pm) because terminal width said no π) from User Contributed Perl Documentation. This is the whole page, no skips, periodt.
πΈ NAME πΈ
Wiki::Toolkit::Formatter::Multiple β literally allows a Wiki::Toolkit wiki to use more than one formatter π
π DESCRIPTION π
It's a "dummy" formatter for Wiki::Toolkit, bestie. What it does is pass methods through to other Wiki::Toolkit formatters, and which one it passes to depends on the supplied metadata. That's the whole vibe check β¨
β¨ SYNOPSIS β¨
Here's the group-chat demo, copied exactly so you can see the config:
use Wiki::Toolkit::Formatter::Multiple;
use Wiki::Toolkit::Formatter::Pod;
use Wiki::Toolkit::Formatter::UseMod;
my $pod_fmtr = Wiki::Toolkit::Formatter::Pod->new(
node_prefix => "wiki.cgi?node=",
);
my $usemod_fmtr = Wiki::Toolkit::Formatter::UseMod->new(
node_prefix => "wiki.cgi?node=",
extended_links => 1,
allowed_tags => [ qw( p b i div br ) ],
);
my $formatter = Wiki::Toolkit::Formatter::Multiple->new(
documentation => $pod_fmtr,
discussion => $usemod_fmtr,
_DEFAULT => $usemod_fmtr,
);
my $wiki = Wiki::Toolkit->new( store => ...,
formatter => $formatter );
my $output = $wiki->format( "This is some discussion.",
{ formatter => "discussion" } );
π METHODS π
These are the methods the page gives you, no gatekeeping π
π§ new π§
my $formatter = Wiki::Toolkit::Formatter::Multiple->new(
label_1 => Formatter1->new( ... ),
label_2 => Formatter2->new( ... ),
_DEFAULT => Wiki::Toolkit::Formatter::Default->new,
);
Okay so you may supply as many formatter objects as you wish. They don't have to be of different classes; maybe you just want to, for example, permit different HTML tags to be used on different types of pages. Cute, right? π¦
The "labels" supplied as the keys of the parameter hash should be unique. When you write a node, you should store a key-value pair in its metadata where the key is "formatter" and the value is the label of the formatter that should be used to render that node. Iykyk π
The "_DEFAULT" label is special β it defines the formatter that will be used for any node that does not have a "formatter" stored in its metadata. The "_DEFAULT" formatter, if not supplied to ->new, will default to the very basic Wiki::Toolkit::Formatter::Default. Slay defaults π
π format( $raw, \%metadata ) π
my $output = $formatter->format( "Here is some text.", undef,
{ formatter => "discussion" } );
It uses the value of "formatter" given in the metadata to decide which of the formatter objects passed on instantiation to use, then uses it to format the provided rawwikitext. So it's like a lil formatter selector, no cap β¨
The "undef" second element of the parameter array in the example is there because when this is called from a Wiki::Toolkit object, the wiki object passes itself in as the second parameter. That's why it's undef in the standalone example, bestie π«Ά
β find_internal_links( $raw, $metadata ) β
That's the signature, and this page doesn't add any extra prose under it β iconic minimalism, honestly π
π¦ SEE ALSO π¦
Wiki::Toolkit
π AUTHOR π
Kake Pugh <kake@earth.li> β crown her π
π«Ά SUPPORT π«Ά
Bug reports, questions and feature requests should go to cgi-wiki-dev@earth.li. Don't be shy, bestie π
π COPYRIGHT π
Copyright (C) 2003-4 Kake Pugh. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Periodt π
Okay that's the whole page, bestie π cute little sign-off: this bad boy was sourced from perl v5.32.0, dated 2021-01-04, and the footer label is Wiki::...ltiple(3pm). Bye, love you, go format something cute ππ¦
π¦ where this page comes from
- debian bookworm: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms