Package qm :: Module structured_text
[show private | hide private]
[frames | no frames]

Module qm.structured_text

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

See "Structured Text Formatting Rules":http://www.python.org/sigs/doc-sig/stext.html for more information.
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.

Function Summary
  __entity_char_replacement(match, replacement_map)
  escape_html_entities(text)
Return 'text' with special characters converted to HTML entities.
  get_first(structured_text)
Return the first line of 'structured_text'.
  get_first_paragraph(structured_text)
Return the first paragraph of 'structured_text'.
  get_paragraphs(structured_text)
Split 'structured_text' into paragraphs.
  get_rest(structured_text)
Return the contents of 'structured_text' minus the first line.
  to_html(structured_text)
Return 'structured_text' formatted as HTML.
  to_text(structured_text, width, indent)
Return 'structured_text' formatted as plain text.
  __format(text, formatter)
Process structured text 'text' with 'formatter'.

Variable Summary
str html_help_text = '\n<h4>Structured Text</h4>\n\n<p>Struc...
SRE_Pattern __entity_char_regex = [å>¥òÈÑÝæäÂ<Îô¸Ê¬&Æø´«­Ì®Ò ÄÃÕßàÔ¼...
SRE_Pattern __paragraph_regexp = (?:\n *)+\n
SRE_Pattern _verbatim_regexp = ('''.*''')(?:(?:\n *)+\n|\n?$)

Function Details

escape_html_entities(text)

Return 'text' with special characters converted to HTML entities.

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(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(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(structured_text)

Return the contents of 'structured_text' minus the first line.

to_html(structured_text)

Return 'structured_text' formatted as HTML.

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.

__format(text, formatter)

Process structured text 'text' with 'formatter'.

Variable Details

html_help_text

Type:
str
Value:
'''
<h4>Structured Text</h4>

<p>Structured text is a simple set of conventions for formatting
ordinary text.  Usually, you can simply type ordinary text where QM
expects structured text; the resulting output will be line-wrapped, wi\
th
paragraph breaks indicated by blank lines.</p>
...                                                                    

__entity_char_regex

Type:
SRE_Pattern
Value:
[å>¥òÈÑÝæäÂ<Îô¸Ê¬&Æø´«­Ì®Ò ÄÃÕßàԼ衽ªÜñÞÿÉêžÙÀðï÷ÖìõÓб˹²³ØÁ¢ë¦í¶µü\
î©ÏçÛ°£¤ûù×ã"Ú¿ýú§¯Çºáé·Í¨þö»âó]                                       

__paragraph_regexp

Type:
SRE_Pattern
Value:
(?:\n *)+\n                                                            

_verbatim_regexp

Type:
SRE_Pattern
Value:
('''.*''')(?:(?:\n *)+\n|\n?$)                                         

Generated by Epydoc 2.1 on Thu Sep 27 15:49:07 2007 http://epydoc.sf.net