Kjetil Kjernsmo > Formatter-HTML-Textile-1.02 > Formatter::HTML::Textile

Download:
Formatter-HTML-Textile-1.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.02   Source  

NAME ^

Formatter::HTML::Textile - Formatter to make HTML from Textile

DESCRIPTION ^

This module will format Textile input to HTML. It conforms with the Formatter API specification, version 1.0.

SYNOPSIS ^

  my $textile = <<TEXTILE;
  h1. textile document
  
  this is a "textile":http://textism.com/tools/textile/ document
  TEXTILE

  my $formatter = Formatter::HTML::Textile->format( $textile );

  print "title is ".$formatter->title."\n";
  print $formatter->document;
  
  my @links = @{ $formatter->links };
  print "Links urls: ";
  print join ", " map { $_->{url} } @links;
  print "\n";

METHODS ^

format($string)

This is a constructor method and initializes the formatter with the passed text.

This method returns a Formatter::HTML::Textile object.

document()

It returns a full HTML document, comprising the formatted textile source converted to HTML. You may specify an optional $charset parameter. This will include a HTML meta element with the chosen character set. It will still be your responsibility to ensure that the document served is encoded with this character set.

fragment()

returns a minimal HTML chunk as textile.

links()

Returns all the links found in the document, as a listref of hashrefs, with keys 'title', which is the title of the link, and 'url', which is the link.

title()

Returns the title of the document

SEE ALSO ^

Formatter, Text::Textile

AUTHOR ^

Originally written by Tom Insam, maintained by Kjetil Kjernsmo from 2005-11-19.

COPYRIGHT ^

Copyright 2005 Tom Insam tom@jerakeen.org, 2005, 2009 Kjetil Kjernsmo, kjetilk@cpan.org.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.

syntax highlighting: