Wiki::...Default(3pm)
β¨ bestie, this is the manual page for Wiki::Toolkit::Formatter::Default β the Wiki::...Default(3pm) entry from User Contributed Perl Documentation. Itβs giving formatter-backend main character energy, and weβre obsessed. π
πΈ NAME πΈ
Wiki::Toolkit::Formatter::Default β a formatter for Wiki::Toolkit. Thatβs the name reveal, periodt. π
π¦ DESCRIPTION π¦
A formatter backend for Wiki::Toolkit. No cap, thatβs the whole description β vibe check passed. β¨
β¨ SYNOPSIS β¨
my $store = Wiki::Toolkit::Store::SQLite->new( ... );
# See below for parameter details.
my $formatter = Wiki::Toolkit::Formatter::Default->new( %config );
my $wiki = Wiki::Toolkit->new( store => $store,
formatter => $formatter );
π METHODS π
π new π
my $formatter = Wiki::Toolkit::Formatter::Default->new(
extended_links => 0,
implicit_links => 1,
allowed_tags => [qw(b i)], # defaults to none
macros => {},
node_prefix => 'wiki.cgi?node=' );
Parameters will default to the values shown above (apart from allowed_tags, which defaults to allowing no tags). π«Ά
extended_linksdefaults to0.implicit_linksdefaults to1.allowed_tagsis shown as[qw(b i)]in the example, but the actual default is allowing no tags at all. πmacrosdefaults to{}. Heads up, bestie: macros are processed after filtering out disallowed HTML tags. Currently macros are just strings; maybe later subs can be added if we think it might be useful. π§node_prefixdefaults to'wiki.cgi?node='.
Macro example:
macros => { qr/(^|\b)\@SEARCHBOX(\b|$)/ =>
qq(<form action="wiki.cgi" method="get">
<input type="hidden" name="action" value="search">
<input type="text" size="20" name="terms">
<input type="submit"></form>) }
πͺ format πͺ
my $html = $formatter->format( $content );
It first escapes any tags that werenβt specified as allowed on creation. Then it interpolates any macros. Then it calls Text::WikiFormat::format (with the config set up when new was called) to translate the raw Wiki language supplied into HTML. The pipeline ate and left no crumbs. π₯
π SEE ALSO π
Go give these a look, iykyk:
Wiki::Toolkit::Formatter::WikiLinkFormatterParentWiki::Toolkit
π AUTHOR π
Kake Pugh (kake@earth.li). π
π COPYRIGHT π
Copyright (C) 2002-2003 Kake Pugh. All Rights Reserved.
Copyright (C) 2006 the Wiki::Toolkit team. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π«Ά
πΈ ok bestie, thatβs the whole page. Footer tea for the very end: perl v5.32.0, 2021-01-04, Wiki::...Default(3pm). Go be iconic with your formatter. π
β¨
π¦ 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