Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wiki::toolkit::formatter::default(3pm) [debian man page]

Wiki::Toolkit::Formatter::Default(3pm)			User Contributed Perl Documentation		    Wiki::Toolkit::Formatter::Default(3pm)

NAME
Wiki::Toolkit::Formatter::Default - A formatter for Wiki::Toolkit. DESCRIPTION
A formatter backend for Wiki::Toolkit. 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). o 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/(^|)@SEARCHBOX(|$)/ => 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 new was called) to translate the raw Wiki language supplied into HTML. SEE ALSO
Wiki::Toolkit::Formatter::WikiLinkFormatterParent Wiki::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. perl v5.14.2 2011-09-25 Wiki::Toolkit::Formatter::Default(3pm)

Check Out this Related Man Page

Wiki::Toolkit::Plugin::Categoriser(3pm) 		User Contributed Perl Documentation		   Wiki::Toolkit::Plugin::Categoriser(3pm)

NAME
Wiki::Toolkit::Plugin::Categoriser - Category management for Wiki::Toolkit. DESCRIPTION
Uses node metadata to build a model of how nodes are related to each other in terms of categories. SYNOPSIS
use Wiki::Toolkit; use Wiki::Toolkit::Plugin::Categoriser; my $wiki = Wiki::Toolkit->new( ... ); $wiki->write_node( "Red Lion", "nice beer", $checksum, { category => [ "Pubs", "Pub Food" ] } ) or die "Can't write node"; $wiki->write_node( "Holborn Station", "busy at peak times", $checksum, { category => "Tube Station" } ) or die "Can't write node"; my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new; $wiki->register_plugin( plugin => $categoriser ); my $isa_pub = $categoriser->in_category( category => "Pubs", node => "Red Lion" ); my @categories = $categoriser->categories( node => "Holborn Station" ); METHODS
new my $categoriser = Wiki::Toolkit::Plugin::Categoriser->new; $wiki->register_plugin( plugin => $categoriser ); in_category my $isa_pub = $categoriser->in_category( category => "Pubs", node => "Red Lion" ); Returns true if the node is in the category, and false otherwise. Note that this is case-insensitive, so "Pubs" is the same category as "pubs". I might do something to make it plural-insensitive at some point too. subcategories $wiki->write_node( "Category Pub Food", "mmm food", $checksum, { category => [ "Pubs", "Food", "Category" ] } ) or die "Can't write node"; my @subcats = $categoriser->subcategories( category => "Pubs" ); # will return ( "Pub Food" ) # Or if you prefer CamelCase node names: $wiki->write_node( "CategoryPubFood", "mmm food", $checksum, { category => [ "Pubs", "Food", "Category" ] } ) or die "Can't write node"; my @subcats = $categoriser->subcategories( category => "Pubs" ); # will return ( "PubFood" ) To add a subcategory "Foo" to a given category "Bar", write a node called any one of "Foo", "Category Foo", or "CategoryFoo" with metadata indicating that it's in categories "Bar" and "Category". Yes, this pays specific attention to the Wiki convention of defining categories by prefacing the category name with "Category" and creating a node by that name. If different behaviour is required we should probably implement it using an optional argument in the constructor. categories my @cats = $categoriser->categories( node => "Holborn Station" ); Returns an array of category names in no particular order. SEE ALSO
o Wiki::Toolkit o Wiki::Toolkit::Plugin AUTHOR
Kake Pugh (kake@earth.li). The Wiki::Toolkit team (http://www.wiki-toolkit.org/) COPYRIGHT
Copyright (C) 2003-4 Kake Pugh. All Rights Reserved. Copyright (C) 2006-2009 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. perl v5.10.1 2009-10-25 Wiki::Toolkit::Plugin::Categoriser(3pm)
Man Page