Author image Ruey-Cheng Chen
and 1 contributors

NAME

Text::KwikiFormat - Translate Kwiki formatted text into HTML

VERSION

Version 0.01

SYNOPSIS

    use Text::KwikiFormat;
    my $html = Text::KwikiFormat::format('some kwiki text');

DESCRIPTION

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.

EXPORT

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

  • as, an alias for the imported function (defaults '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';

SUBROUTINES/METHODS

This module supports only one interface subroutine format().

format($text, $newtags, $opts)

The first argument $text is the text to convert.

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:

  • prefix

    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=' }

LIMITATIONS

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.)

AUTHOR

Ruey-Cheng Chen, <rueycheng at gmail.com>

BUGS

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.

LICENSE AND COPYRIGHT

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.