Text::KwikiFormat - Translate Kwiki formatted text into HTML
Version 0.01
use Text::KwikiFormat; my $html = Text::KwikiFormat::format('some kwiki text');
This module allows you to convert Kwiki text using the Kwiki::Formatter module. In the current version, it only passes the input to the formatter and spits out the converted HTML content as it. Customization is not supported.
For people interested in using CGI::Kwiki to convert the Kwiki text, see the module Text::KwikiFormatish.
You can also import a customized subroutine with default options set up, pretty much the same way as in Text::WikiFormat. Currently, only two keys are supported:
prefix, the KwikiLink prefix
prefix
as, an alias for the imported function (defaults 'wikiformat')
as
wikiformat
Examples:
# import 'kwikiformat' use Text::KwikiFormat 'kwikiformat'; # ... the same thing use Text::KwikiFormat as => 'kwikiFormat'; # import 'wikiformat' with a custom prefix use Text::KwikiFormat prefix => 'http://www.example.com/'; my $text = wikiformat 'some kwiki text';
This module supports only one interface subroutine format().
format()
The first argument $text is the text to convert.
$text
The second argument is not used. I keep it here to comply with the Text::WikiFormat calling convention.
The options are specified as a hash reference via the third argument $opts. Currently, only one option is supported:
$opts
This is the path to the Wiki. The actual linked item itself will be appended to the prefix. This is useful to create full URIs:
{ prefix => 'http://example.com/kwiki.pl?page=' }
The current version does one and only one thing: send the input to Kwiki and fetch the output AS IS. To customize the output format, one needs to subclass all the necessary Kwiki::Formatter::* modules and rework the HTML output, which is a lot of work. (I will reconsider implementing that based on the number of RT tickets asking for this feature.)
Ruey-Cheng Chen, <rueycheng at gmail.com>
<rueycheng at gmail.com>
Please report any bugs or feature requests to bug-text-kwikiformat at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-KwikiFormat. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-text-kwikiformat at rt.cpan.org
Copyright 2012 Ruey-Cheng Chen.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Text::KwikiFormat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::KwikiFormat
CPAN shell
perl -MCPAN -e shell install Text::KwikiFormat
For more information on module installation, please visit the detailed CPAN module installation guide.