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

ClassType HTMLDoctestColorizer

source code


A subclass of DoctestColorizer that generates HTML output.

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

Inherited from DoctestColorizer: colorize_codeblock, colorize_doctest, colorize_inline, subfunc

Class Variables [hide private]
  PREFIX = '<pre class="py-doctest">\n'
A string that is added to the beginning of the strings returned by colorize_codeblock and colorize_doctest.
  SUFFIX = '</pre>\n'
A string that is added to the end of the strings returned by colorize_codeblock and colorize_doctest.

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

Method Details [hide private]

markup(self, s, tag)

source code 
call graph 

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)