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.
  End(self)
End the processed text document.
  WriteText(self, text)
Write ordinary text.
  StartList(self, type)
Start a list environment of type 'type'.
  EndList(self, type)
End a list environment of type 'type'.
  StartItem(self, type, label=None)
Begin an element to the environment of type 'type'.
  FinishDefinedTerm(self)
Finish the definition of a term in a definition list.
  EndItem(self, type)
End an element in the environment of type 'type'.
  StartStyle(self, style)
Start a new text style 'style'.
  EndStyle(self, style)
End the text style 'style'.
  StartLink(self, target)
Being a hyperlink to 'target'.
  EndLink(self)
End a hyperlink.
  __IndentTo(self, col)
  __Write(self, text)
  __NextLine(self)

Class Variables [hide private]
__style_markers  

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.

End(self)

source code 
End the processed text document.

WriteText(self, text)

source code 
Write ordinary text.

StartList(self, type)

source code 
Start a list environment of type 'type'.

EndList(self, type)

source code 
End a list environment of type 'type'.

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.

FinishDefinedTerm(self)

source code 
Finish the definition of a term in a definition list.

EndItem(self, type)

source code 
End an element in the environment of type 'type'.

StartStyle(self, style)

source code 
Start a new text style 'style'.

EndStyle(self, style)

source code 
End the text style 'style'.

StartLink(self, target)

source code 
Being a hyperlink to 'target'.

EndLink(self)

source code 
End a hyperlink.

__IndentTo(self, col)

source code 

__Write(self, text)

source code 

__NextLine(self)

source code 

Class Variable Details [hide private]

__style_markers

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