NAME

Markup::Unified - A simple, unified interface for Textile, Markdown and BBCode.

VERSION

Version 0.01

SYNOPSIS

use Markup::Unified;

my $o = Markup::Unified->new();
my $text = 'h1. A heading';
$o->format($text, 'textile');

print $o->formatted; # produces "<h1>A heading</h1>"
print $o->unformatted; # produces "h1. A heading"

# you can also just say:
print $o; # same as "print $o->formatted;"

DESCRIPTION

This module provides a simple, unified interface for the Text::Textile, Text::Markdown and HTML::BBCode markup languages modules. This module is primarily meant to provide a simple way for application developers to deal with texts that use different markup languages, for example, a message board where users have the ability to post with their preferred markup language.

Please note that this module expects your texts to be UTF-8.

METHODS

format( $text, $markup_lang )

Formats the provided text with the provided markup language. $markup_lang must be one of 'bbcode', 'textile' or 'markdown' (case insensitive); otherwise the text will remain unprocessed.

formatted()

Returns the formatted text of the object, with whatever markup language it was set.

This module also provides the ability to print the formatted version of an object without calling formatted() explicitly, so you can just use print $obj.

unformatted()

Returns the unformatted text of the object.

INTERNAL METHODS

_bbcode( $text )

Formats $text with HTML::BBCode.

_textile( $text )

Formats $text with Text::Textile.

_markdown( $text )

Formats $text with Text::Markdown.

AUTHOR

Ido Perlmuter, <ido at fc-bnei-yehuda.com>

BUGS

Please report any bugs or feature requests to bug-markup-unified at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Markup-Unified. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

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

perldoc Markup::Unified

You can also look for information at:

SEE ALSO

Text::Textile, Text::Markdown, HTML::BBCode, DBIx::Class::InflateColumn::Markup::Unified

COPYRIGHT & LICENSE

Copyright 2009 Ido Perlmuter.

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.