Parser and formatter for Python structured text.
|
|
|
NormalizeSpaces(self,
text)
Return 'text' with spaces normalized. |
source code
|
|
|
__call__(self,
text)
Process structured text 'text'. |
source code
|
|
|
End(self)
Stop processing text, and do any necessary cleanup. |
source code
|
|
|
__PushType(self,
type,
indentation)
Start a new environment. |
source code
|
|
|
__PopType(self)
End and remove the innermost environment. |
source code
|
|
|
__SetType(self,
type,
indentation,
label=None)
Set the environment type and indentation level. |
source code
|
|
|
__WriteText(self,
text)
Write paragraph text. |
source code
|
|
|
__punctuation = ' [][)(.,!?;:\'" ] '
|
|
__bullet_regex = re.compile(r'^[ -o\*] + ')
|
|
__sequence_regex = re.compile(r'^( [ A- Za- z] + \.| [ 0- 9] + \.? ) + + ')
|
|
__definition_regex = re.compile(r'^( .* ) + -- + ')
|
|
__collapse_regex = re.compile(r'(?m) * \n * ')
|
|
__indent_regex = re.compile(r'^ * ')
|
|
__literal_regex = re.compile(r'( + | ^) \'( [^ \'] + ) \'( [ \]\[\)\(\.,...
|
|
__strong_regex = re.compile(r'( + | ^) \*\*( [^ \*] + ) \*\*( [ \]\[\)\(...
|
|
__emph_regex = re.compile(r'( + | ^) \*( [^ \*] + ) \*( [ \]\[\)\(\.,!\?...
|
|
__underline_regex = re.compile(r'( + | ^) _( [^ _] + ) _( [ \]\[\)\(\.,!...
|
|
__link_regex = re.compile(r'"( [^ "] * ) "')
|
|
__link_footnote_regex = re.compile(r'\n\.\. * "( [^ "] * ) " * ( [ ^ \n...
|
|
__non_nestable_types = [ ' paragraph ' ]
|