Package epydoc :: Package markup :: Module doctest :: Class LaTeXDoctestColorizer
[hide private]
[frames] | no frames]

ClassType LaTeXDoctestColorizer

source code


A subclass of DoctestColorizer that generates LaTeX output.

Instance Methods [hide private]
 
markup(self, s, tag)
Apply syntax highlighting to a single substring from a doctest block.
source code

Inherited from DoctestColorizer: colorize_codeblock, colorize_doctest, colorize_inline, subfunc

Class Variables [hide private]
  PREFIX = '\\begin{alltt}'
A string that is added to the beginning of the strings returned by colorize_codeblock and colorize_doctest.
  SUFFIX = '\\end{alltt}\n'
A string that is added to the end of the strings returned by colorize_codeblock and colorize_doctest.
  NEWLINE = '\\\\'
The string used to divide lines

Inherited from DoctestColorizer: DOCTEST_DIRECTIVE_RE, DOCTEST_EXAMPLE_RE, DOCTEST_RE, EXCEPT_RE, PROMPT2_RE, PROMPT_RE

Method Details [hide private]

markup(self, s, tag)

source code 

Apply syntax highlighting to a single substring from a doctest block. s is the substring, and tag is the tag that should be applied to the substring. tag will be one of the following strings:

  • prompt -- the Python PS1 prompt (>>>)
  • more -- the Python PS2 prompt (...)
  • keyword -- a Python keyword (for, if, etc.)
  • builtin -- a Python builtin name (abs, dir, etc.)
  • string -- a string literal
  • comment -- a comment
  • except -- an exception traceback (up to the next >>>)
  • output -- the output from a doctest block.
  • defname -- the name of a function or class defined by a def or class statement.
  • other -- anything else (does *not* include output.)
Overrides: DoctestColorizer.markup
(inherited documentation)