AnewtTextile Class Reference

Textile formatting class. More...

List of all members.

Public Member Functions

 AnewtTextile ()
 Constructor method.
 process ($text)
 Processes the text.

Private Member Functions

 _normalize_text ($text)
 Normalize text by cleaning up newlines and whitespace.
 _split_into_blocks ($text)
 Splits text into blocks.
 _parse_block ($text)
 Parse a block of text with optional modifiers.
 _parse_list ($text)
 Parse a block of text into a list structure.
 _process_block ($text)
 Process a single block of text.
 _build_html_block_element ($tag_name, $parsed_block)
 Build a block level HTML element with the specified properties.
 _format_paragraph ($parsed_block)
 Formats a single paragraph.
 _format_blockquote ($parsed_block)
 Format a block quote.
 _format_header ($parsed_block)
 Formats a header block.
 _format_list ($items, $type=null)
 Format a list block.
 _format_inline ($inline)
 Format inline text.

Private Attributes

 $_saved_block_modifiers = array()
 The block modifiers used in block continuation mode, if enabled.


Detailed Description

Textile formatting class.

This class transforms input text in textile format into valid XHTML strict.

The Textile class has several attributes to control the behaviour of the engine.

The above attributes can be queried and set using the standard AnewtContainer::get and AnewtContainer::set methods.

Definition at line 125 of file textile.lib.php.


Member Function Documentation

AnewtTextile::AnewtTextile (  ) 

Constructor method.

Initialises the default settings.

Definition at line 133 of file textile.lib.php.

AnewtTextile::_normalize_text ( text  )  [private]

Normalize text by cleaning up newlines and whitespace.

Parameters:
$text The text string to normalize
Returns:
Normalized string

Definition at line 152 of file textile.lib.php.

AnewtTextile::_split_into_blocks ( text  )  [private]

Splits text into blocks.

The input text is split into blocks that can be separately formatted. Both line folded and non-line folded text is handled, as well as lists, tables en pre-formatted code.

Parameters:
$text Text to split into blocks
Returns:
An array containing all blocks

Definition at line 176 of file textile.lib.php.

AnewtTextile::_parse_block ( text  )  [private]

Parse a block of text with optional modifiers.

Parameters:
$text A block of text
Returns:
Associative array containing all block properties (or default values)

Definition at line 212 of file textile.lib.php.

AnewtTextile::_parse_list ( text  )  [private]

Parse a block of text into a list structure.

If this block is not a list NULL is returned.

Parameters:
$text The text to parse into a list.

Definition at line 313 of file textile.lib.php.

AnewtTextile::_process_block ( text  )  [private]

Process a single block of text.

This method detects the type of block and formats it accordingly. It detects headers, paragraphs, block quotes, lists, tables and preformatted code.

Parameters:
$text The input text, e.g. obtained using from _split_into_blocks.
Returns:
XHTML-formatted output

Definition at line 362 of file textile.lib.php.

AnewtTextile::_build_html_block_element ( tag_name,
parsed_block 
) [private]

Build a block level HTML element with the specified properties.

Parameters:
$tag_name The name of the XHTML tag that should be created. Only a few block-level tags can be handled.
$parsed_block A parsed block
Returns:
XHTML snippet as a string

Definition at line 423 of file textile.lib.php.

AnewtTextile::_format_paragraph ( parsed_block  )  [private]

Formats a single paragraph.

This method will format a paragraph, processing several optional markup attributes.

Parameters:
$parsed_block A parsed block

Definition at line 532 of file textile.lib.php.

AnewtTextile::_format_blockquote ( parsed_block  )  [private]

Format a block quote.

Parameters:
$parsed_block A parsed block instance
Returns:
Blockquote HTML for this block.

Definition at line 549 of file textile.lib.php.

AnewtTextile::_format_header ( parsed_block  )  [private]

Formats a header block.

This method will format a paragraph, processing several optional markup attributes.

Parameters:
$parsed_block A parsed block

Definition at line 567 of file textile.lib.php.

AnewtTextile::process ( text  ) 

Processes the text.

This method will transform the input text into XHTML, thereby converting headers, paragraphs, lists, block quotes and other block elements into their corresponding XHTML tags. Hyperlinks, inline markup (like emphasized or strong words), images and code is also converted. Additionally, several typographic enhancements are made to inline text (curly quotes, em dashes, entity replacements, etc).

Parameters:
$text Input text in Textile format
Returns:
Processed text in XHTML format

Definition at line 772 of file textile.lib.php.


The documentation for this class was generated from the following file:

Generated on Sun Aug 2 22:54:38 2009 for Anewt by  doxygen 1.5.9