Table of Contents

Module: structured_text qm/structured_text.py

Functions for parsing, processing, and formatting Python structured text.

See Structured Text Formatting Rules for more information.

Functions   
__format
escape_html_entities
get_first
get_first_paragraph
get_paragraphs
get_rest
to_html
to_text
  __format 
__format ( text,  formatter )

Process structured text text with formatter.

  escape_html_entities 
escape_html_entities ( text )

Return text with special characters converted to HTML entities.

  get_first 
get_first ( structured_text )

Return the first line of structured_text.

By convention, the first line of a structured text description is a short summary.

  get_first_paragraph 
get_first_paragraph ( structured_text )

Return the first paragraph of structured_text.

structured_text
A string consisting of structured text.
returns
A string of structured text that is the first paragraph of the structured_text.
  get_paragraphs 
get_paragraphs ( structured_text )

Split structured_text into paragraphs.

structured_text
A string consisting of structured text.
returns
A sequence of pagraphs of structured text. Each element in the sequence corresponds to a successive pagraph in the structured_text. If structured_text is the empty string, the sequence returned will consist of a single paragraph, itself empty.
  get_rest 
get_rest ( structured_text )

Return the contents of structured_text minus the first line.

  to_html 
to_html ( structured_text )

Return structured_text formatted as HTML.

  to_text 
to_text (
        structured_text,
        width=78,
        indent=0,
        )

Return structured_text formatted as plain text.

width
The width of the text (including the indentation).
indent
The width of the block indentation of the formatted output.
Classes   

Formatter

Interface for output formatters for the StructuredTextProcessor.

HtmlFormatter

Formatter for generating HTML from structured text.

StructuredTextProcessor

Parser and formatter for Python structured text.

TextFormatter

Formatter for generating plain text from structured text.


Table of Contents

This document was automatically generated on Mon Jan 3 09:42:29 2005 by HappyDoc version 2.1