Main Page | Class Hierarchy | Class List | File List | Class Members

MTLikeTextile Class Reference

A Textile implementation providing additional Movable-Type-like formatting to produce results similar to the mttextile plugin. More...

Inheritance diagram for MTLikeTextile:

Textile List of all members.

Public Member Functions

 MTLikeTextile ($options=array())

Private Member Functions

 process_quotes ($str)
 format_url ($args)

Detailed Description

A Textile implementation providing additional Movable-Type-like formatting to produce results similar to the mttextile plugin.

Brad Choate's mttextile Movable Type plugin adds some additional functionality to the Textile.pm Perl module. This includes optional "SmartyPants" processing of text to produce smart quotes, dashes, etc., code colorizing using Beautifier, and some special lookup links (imdb, google, dict, and amazon). The MTLikeTextile class is a subclass of Textile that provides an MT-like implementation of Textile to produce results similar to that of the mttextile plugin. Currently only the SmartyPants and special lookup links are implemented.

Using the MTLikeTextile class is exactly the same as using Textile. Simply use $textile = new MTLikeTextile; instead of $textile = new Textile; to create a Textile object. This will enable the special lookup links. To enable SmartyPants processing, you must install the SmartyPants-PHP implementation available at http://monauraljerk.org/smartypants-php/ and include the SmartyPants-PHP.inc file.


 include_once("Textile.php");
 include_once("SmartyPants-PHP.inc");
 $text = <<<EOT
 h1. Heading

 A _simple_ demonstration of Textile markup.

 * One
 * Two
 * Three

 "More information":http://www.textism.com/tools/textile is available.
 EOT;

 $textile = new MTLikeTextile;
 $html = $textile->process($text);
 print $html;
 

Author:
Jim Riggs <textile at jimandlisa dot com>

Definition at line 3337 of file Textile.php.


Constructor & Destructor Documentation

MTLikeTextile::MTLikeTextile options = array()  ) 
 

Instantiates a new MTLikeTextile object. Optional options can be passed to initialize the object. Attributes for the options key are the same as the get/set method names documented here.

Parameters:
$options The array specifying the options to use for this object.

Definition at line 3349 of file Textile.php.


Member Function Documentation

MTLikeTextile::format_url args  )  [private]
 

Takes the given $url and transforms it appropriately.

Parameters:
$args An array specifying the attributes for formatting the url.
Returns:
A string containing the formatted url.

Reimplemented from Textile.

Definition at line 3367 of file Textile.php.

References format_url().

Referenced by format_url().

MTLikeTextile::process_quotes str  )  [private]
 

Processes string, formatting plain quotes into curly quotes.

Parameters:
$str A string specifying the text to process.
Returns:
A string containing the processed text.

Reimplemented from Textile.

Definition at line 3356 of file Textile.php.

References process_quotes().

Referenced by process_quotes().


The documentation for this class was generated from the following file:
Generated on Mon Mar 21 08:37:29 2005 for TextilePHP by doxygen 1.3.7