Text::Textile::RTF - Generate RTF output from Textile mark-up
use Text::Textile::RTF qw(textile); my $textile = <<EOT; h1. Heading A _simple_ demonstration of Textile markup. * One * Two * Three "More information":http://www.textism.com/tools/textile is available. EOT # Procedural interface: my $text = textile($textile); print $text; # Object-oriented interface my $ttrtf = Text::Textile::RTF->new(); $rtf = $ttrtf->process($textile);
Text::Textile::RTF is a sub-class of Text::Textile::Plaintext that produces RTF output instead of plain text. See Text::Textile::Plaintext for more detail.
This class only defines the following two methods. It inherits everything else from Text::Textile::Plaintext.
Create a new instance of this class. This constructor calls the super-class constructor after handling the
formatterparameter and setting up an instance of HTML::FormatRTF to pass to the parent. This method only handles the following parameter:
Specify either a pre-created instance of HTML::FormatRTF (or a suitable sub-class) or a hash-reference of parameters to pass to the constructor when creating one. If this parameter is not present, an object is created with the default parameters (as according to HTML::FormatRTF).
See documentation of the new() method in Text::Textile::Plaintext for additional recognized parameters.
This method is defined in this class so that it can be imported and used procedurally, as textile() is used in either Text::Textile::Plaintext or Text::Textile itself. It renders the Textile mark-up in
$textileto HTML, then renders the resulting HTML tree into RTF. It returns the RTF content as a single string.
Please report any bugs or feature requests to
bug-text-textile-plaintext at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Text-Textile-Plaintext. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
Source code on GitHub
COPYRIGHT & LICENSE
This file and the code within are copyright (c) 2009 by Randy J. Ray.
Copying and distribution are permitted under the terms of the Artistic License 2.0 (http://www.opensource.org/licenses/artistic-license-2.0.php) or the GNU LGPL 2.1 (http://www.opensource.org/licenses/lgpl-2.1.php).
Randy J. Ray