Syntax highlighting for blocks of Python code.
| Function | colorize |
Colorize a string containing only Python code. This method differs from colorize_doctest in that it will not search for doctest prompts when deciding how to colorize the string. |
| Function | colorize |
Undocumented |
| Function | colorize |
Perform syntax highlighting on the given doctest string, and return the resulting HTML code. |
| Function | colorize |
Undocumented |
| Function | subfunc |
Undocumented |
| Constant | DEFINE |
A regexp that decomposes function definitions. |
| Constant | DOCTEST |
A regexp that matches doctest directives. |
| Constant | DOCTEST |
This regular expression is used to find doctest examples in a string. This is copied from the standard Python doctest.py module (after the refactoring in Python 2.4+). |
| Constant | DOCTEST |
A regexp that matches all of the regions of a doctest block that should be colored. |
| Constant | EXCEPT |
A regexp that matches doctest exception blocks. |
| Constant | PROMPT2 |
A regexp that matches Python "..." prompts. |
| Constant | PROMPT |
A regexp that matches Python prompts |
| Constant | _BUILTIN |
A regexp group that matches Python builtins. |
| Constant | _BUILTINS |
A list of all Python builtins. |
| Constant | _COMMENT |
A regexp group that matches Python comments. |
| Constant | _DEFINE |
A regexp group that matches function and class definitions. |
| Constant | _KEYWORD |
A regexp group that matches keywords. |
| Constant | _KEYWORDS |
A list of the names of all Python keywords. |
| Constant | _PROMPT1 |
A regexp group that matches Python ">>>" prompts. |
| Constant | _PROMPT2 |
A regexp group that matches Python "..." prompts. |
| Constant | _STRING |
A regexp group that matches Python strings. |
Colorize a string containing only Python code. This method differs from colorize_doctest in that it will not search for doctest prompts when deciding how to colorize the string.
This code consists of a <pre> block with class=py-doctest. Syntax highlighting is performed using the following CSS classes:
- py-keyword -- a Python keyword (for, if, etc.)
- py-builtin -- a Python builtin name (abs, dir, etc.)
- py-string -- a string literal
- py-comment -- a comment
- py-except -- an exception traceback (up to the next >>>)
- py-output -- the output from a doctest block.
- py-defname -- the name of a function or class defined by a def or class statement.
Perform syntax highlighting on the given doctest string, and return the resulting HTML code.
This code consists of a <pre> block with class=py-doctest. Syntax highlighting is performed using the following CSS classes:
- py-prompt -- the Python PS1 prompt (>>>)
- py-more -- the Python PS2 prompt (...)
- the CSS classes output by
colorize_codeblock
A regexp that decomposes function definitions.
| Value |
|
This regular expression is used to find doctest examples in a string. This is copied from the standard Python doctest.py module (after the refactoring in Python 2.4+).
| Value |
|
A regexp that matches all of the regions of a doctest block that should be colored.
| Value |
|
A regexp that matches doctest exception blocks.
| Value |
|
A regexp that matches Python "..." prompts.
| Value |
|
A regexp that matches Python prompts
| Value |
|
A regexp group that matches Python builtins.
| Value |
|
A list of the names of all Python keywords.
| Value |
|