Wiki::Toolkit::Formatter::Default3pm
A formatter for wiki::toolkit.
Usage
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 );
Overview
A formatter backend for Wiki::Toolkit.
Methods
new-
my $formatter = Wiki::Toolkit::Formatter::Default->new(extended_links => 0,implicit_links => 1,allowed_tags => [qw(b i)], # defaults to nonemacros => {},node_prefix => 'wiki.cgi?node=' );Parameters will default to the values shown above (apart from
"allowed_tags", which defaults to allowing no tags).- •
-
macros - be aware that macros are processed after filtering out disallowed HTML tags. Currently macros are just strings, maybe later we can add in subs if we think it might be useful.
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 );Escapes any tags which weren't specified as allowed on creation, then interpolates any macros, then calls Text::WikiFormat::format (with the config set up when
newwas called) to translate the raw Wiki language supplied into HTML.
Releases
10 releases since Debian 4.0 (Etch); the text changed 6 times.