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

Class TextFormatter

source code

Formatter --+
            |
           TextFormatter

Formatter for generating plain text from structured text.

Instance Methods [hide private]
 
__init__(self, output_file=sys.stdout, width=78, indent_size=2, indent=0, list_bullet='-')
Create a new HTML formatter.
source code
 
End(self)
End the processed text document.
source code
 
WriteText(self, text)
Write ordinary text.
source code
 
StartList(self, type)
Start a list environment of type 'type'.
source code
 
EndList(self, type)
End a list environment of type 'type'.
source code
 
StartItem(self, type, label=None)
Begin an element to the environment of type 'type'.
source code
 
FinishDefinedTerm(self)
Finish the definition of a term in a definition list.
source code
 
EndItem(self, type)
End an element in the environment of type 'type'.
source code
 
StartStyle(self, style)
Start a new text style 'style'.
source code
 
EndStyle(self, style)
End the text style 'style'.
source code
 
StartLink(self, target)
Being a hyperlink to 'target'.
source code
 
EndLink(self)
End a hyperlink.
source code
 
__IndentTo(self, col) source code
 
__Write(self, text) source code
 
__NextLine(self) source code
Class Variables [hide private]
  __style_markers = {'emphasized': '*', 'literal': '\'', 'strong...
Method Details [hide private]

__init__(self, output_file=sys.stdout, width=78, indent_size=2, indent=0, list_bullet='-')
(Constructor)

source code 

Create a new HTML formatter.

'output_file' -- A file object to which HTML source is written.

StartItem(self, type, label=None)

source code 

Begin an element to the environment of type 'type'.

'label' -- If type is "ordered list", this is the label for this list element.


Class Variable Details [hide private]

__style_markers

Value:
{'emphasized': '*',
 'literal': '\'',
 'strong': '**',
 'underlined': '_',
 'verbatim': '\'\'\''}