Wiki::Toolkit::Formatter::Mediawiki - A Mediawiki-style formatter for


Wiki-Toolkit-Formatter-Mediawiki documentation  | view source Contained in the Wiki-Toolkit-Formatter-Mediawiki distribution.

Index


NAME

Top

Wiki::Toolkit::Formatter::Mediawiki - A Mediawiki-style formatter for Wiki::Toolkit.

VERSION

Top

Version 0.04

SYNOPSIS

Top

This package implements a formatter for the Wiki::Toolkit module which attempts to duplicate the behavior of the Mediawiki application (a set of PHP scripts used by Wikipedia and friends).

    use Wiki::Toolkit
    use Wiki::Toolkit::Store::Mediawiki;
    use Wiki::Toolkit::Formatter::Mediawiki;

    my $store = Wiki::Toolkit::Store::Mediawiki->new ( ... );
    # See below for parameter details.
    my $formatter = Wiki::Toolkit::Formatter::Mediawiki->new (%config,
							      store => $store);
    my $wiki = Wiki::Toolkit->new (store => $store, formatter => $formatter);

METHODS

Top

new

  my $store = Wiki::Toolkit::Store::Mediawiki->new ( ... );
  my $formatter = Wiki::Toolkit::Formatter::Mediawiki->new
	(allowed_tags => [# HTML
			  qw(b big blockquote br caption center cite code dd
			     div dl dt em font h1 h2 h3 h4 h5 h6 hr i li ol p
			     pre rb rp rt ruby s small strike strong sub sup
                             table td th tr tt u ul var),
			  # MediaWiki Specific
			  qw(nowiki),],
	 allowed_attrs => [qw(title align lang dir width height bgcolor),
			   qw(clear), # BR
			   qw(noshade), # HR
			   qw(cite), # BLOCKQUOTE, Q
			   qw(size face color), # FONT
			   # For various lists, mostly deprecated but
			   # safe
			   qw(type start value compact),
			   # Tables
			   qw(summary width border frame rules
			      cellspacing cellpadding valign char
			      charoff colgroup col span abbr axis
			      headers scope rowspan colspan),
			   qw(id class name style), # For CSS
			  ],
	 node_prefix => '',
	 store => $store);

Parameters will default to the values above, with the exception of store, which is a required argument without a default. store does not have to be of type Wiki::Toolkit::Store::Mediawiki.

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 specialized Mediawiki config) to translate the raw Wiki language supplied into HTML.

SEE ALSO

Top

Wiki::Toolkit::Kwiki
Wiki::Toolkit
Wiki::Toolkit::Formatter::Default
Wiki::Toolkit::Store::Mediawiki

AUTHOR

Top

Derek R. Price, <derek at ximbiot.com>

BUGS

Top

Please report any bugs or feature requests to bug-cgi-wiki-formatter-mediawiki at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Wiki-Toolkit-Formatter-Mediawiki. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Wiki::Toolkit::Formatter::Mediawiki

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Wiki-Toolkit-Formatter-Mediawiki

* CPAN Ratings

http://cpanratings.perl.org/d/Wiki-Toolkit-Formatter-Mediawiki

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Wiki-Toolkit-Formatter-Mediawiki

* Search CPAN

http://search.cpan.org/dist/Wiki-Toolkit-Formatter-Mediawiki

ACKNOWLEDGEMENTS

Top

My thanks go to Kake Pugh, for providing the well written Wiki::Toolkit and Wiki::Toolkit::Kwiki modules, which got me started on this.

COPYRIGHT & LICENSE

Top


Wiki-Toolkit-Formatter-Mediawiki documentation  | view source Contained in the Wiki-Toolkit-Formatter-Mediawiki distribution.