<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>epydoc.markup.doctest.HTMLDoctestColorizer</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th> <a href="epydoc-module.html">Home</a> </th> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="http://epydoc.sourceforge.net">epydoc 3.0.1</a></th> </tr></table></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> <a href="epydoc-module.html">Package epydoc</a> :: <a href="epydoc.markup-module.html">Package markup</a> :: <a href="epydoc.markup.doctest-module.html">Module doctest</a> :: Class HTMLDoctestColorizer </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide private</a>]</span></td></tr> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >] | <a href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html" target="_top">no frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class HTMLDoctestColorizer</h1><p class="nomargin-top"><span class="codelink"><a href="epydoc.markup.doctest-pysrc.html#HTMLDoctestColorizer">source code</a></span></p> <center> <center> <map id="uml_class_diagram_for_epydoc_m_6" name="uml_class_diagram_for_epydoc_m_6"> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#PROMPT_RE" title="A regexp that matches Python prompts" alt="" coords="17,28,300,47" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#PROMPT2_RE" title="A regexp that matches Python "..." prompts." alt="" coords="17,47,300,65" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#EXCEPT_RE" title="A regexp that matches doctest exception blocks." alt="" coords="17,65,300,84" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#DOCTEST_DIRECTIVE_RE" title="A regexp that matches doctest directives." alt="" coords="17,84,300,103" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#DOCTEST_RE" title="A regexp that matches all of the regions of a doctest block that should be colored." alt="" coords="17,103,300,121" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#DOCTEST_EXAMPLE_RE" title="This regular expression is used to find doctest examples in a string." alt="" coords="17,121,300,140" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_inline" title="Colorize a string containing Python code." alt="" coords="17,143,300,161" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_codeblock" title="Colorize a string containing only Python code." alt="" coords="17,161,300,180" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_doctest" title="Colorize a string containing one or more doctest examples." alt="" coords="17,180,300,199" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#subfunc" title="epydoc.markup.doctest.DoctestColorizer.subfunc" alt="" coords="17,199,300,217" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html" title="An abstract base class for performing syntax highlighting on doctest blocks and other bits of Python code." alt="" coords="5,5,312,224" /> <area shape="rect" href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html#PREFIX" title="A string that is added to the beginning of the strings returned by colorize_codeblock and colorize_doctest." alt="" coords="91,265,227,284" /> <area shape="rect" href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html#SUFFIX" title="A string that is added to the end of the strings returned by colorize_codeblock and colorize_doctest." alt="" coords="91,284,227,303" /> <area shape="rect" href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html#markup" title="Apply syntax highlighting to a single substring from a doctest block." alt="" coords="91,305,227,324" /> <area shape="rect" href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html" title="A subclass of DoctestColorizer that generates HTML output." alt="" coords="79,243,239,331" /> </map> <img src="uml_class_diagram_for_epydoc_m_6.gif" alt='' usemap="#uml_class_diagram_for_epydoc_m_6" ismap="ismap" class="graph-without-title" /> </center> </center> <hr /> <p>A subclass of DoctestColorizer that generates HTML output.</p> <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Methods</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceMethods" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html#markup" class="summary-sig-name">markup</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">s</span>, <span class="summary-sig-arg">tag</span>)</span><br /> Apply syntax highlighting to a single substring from a doctest block.</td> <td align="right" valign="top"> <span class="codelink"><a href="epydoc.markup.doctest-pysrc.html#HTMLDoctestColorizer.markup">source code</a></span> <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_markup_2-summary-div');return false;">call graph</a></span> </td> </tr> </table> <div style="display:none" id="call_graph_for_markup_2-summary-div"><center> <table border="0" cellpadding="0" cellspacing="0"> <tr><td><center> <map id="call_graph_for_markup_2" name="call_graph_for_markup_2"> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_doctest" title="DoctestColorizer.colorize_doctest()" alt="" coords="7,6,295,38" /> <area shape="rect" href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html#markup" title="markup()" alt="" coords="344,34,435,66" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#subfunc" title="DoctestColorizer.subfunc()" alt="" coords="37,62,264,94" /> <area shape="rect" href="epydoc.util-module.html#plaintext_to_html" title="util.plaintext_to_html()" alt="" coords="483,34,680,66" /> </map> <img src="call_graph_for_markup_2.gif" alt='' usemap="#call_graph_for_markup_2" ismap="ismap" class="graph-without-title" /> </center></td></tr> <tr><th>Call Graph</th></tr> </table><br /> </center></div> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html">DoctestColorizer</a></code></b>: <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_codeblock">colorize_codeblock</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_doctest">colorize_doctest</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_inline">colorize_inline</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#subfunc">subfunc</a></code> </p> </td> </tr> </table> <!-- ==================== CLASS VARIABLES ==================== --> <a name="section-ClassVariables"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Class Variables</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-ClassVariables" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="PREFIX"></a><span class="summary-name">PREFIX</span> = <code title="'''<pre class="py-doctest"> '''"><code class="variable-quote">'</code><code class="variable-string"><pre class="py-doctest">\n</code><code class="variable-quote">'</code></code><br /> A string that is added to the beginning of the strings returned by <a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_codeblock" class="link">colorize_codeblock</a> and <a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_doctest" class="link">colorize_doctest</a>. </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type"> </span> </td><td class="summary"> <a name="SUFFIX"></a><span class="summary-name">SUFFIX</span> = <code title="'''</pre> '''"><code class="variable-quote">'</code><code class="variable-string"></pre>\n</code><code class="variable-quote">'</code></code><br /> A string that is added to the end of the strings returned by <a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_codeblock" class="link">colorize_codeblock</a> and <a href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_doctest" class="link">colorize_doctest</a>. </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html">DoctestColorizer</a></code></b>: <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#DOCTEST_DIRECTIVE_RE">DOCTEST_DIRECTIVE_RE</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#DOCTEST_EXAMPLE_RE">DOCTEST_EXAMPLE_RE</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#DOCTEST_RE">DOCTEST_RE</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#EXCEPT_RE">EXCEPT_RE</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#PROMPT2_RE">PROMPT2_RE</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#PROMPT_RE">PROMPT_RE</a></code> </p> <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html">DoctestColorizer</a></code></b> (private): <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_BI" onclick="show_private();">_BI</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_BUILTINS" onclick="show_private();">_BUILTINS</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_BUILTIN_GRP" onclick="show_private();">_BUILTIN_GRP</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_COMMENT_GRP" onclick="show_private();">_COMMENT_GRP</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_DEFINE_GRP" onclick="show_private();">_DEFINE_GRP</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_KEYWORDS" onclick="show_private();">_KEYWORDS</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_KEYWORD_GRP" onclick="show_private();">_KEYWORD_GRP</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_KW" onclick="show_private();">_KW</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_PROMPT1_GRP" onclick="show_private();">_PROMPT1_GRP</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_PROMPT2_GRP" onclick="show_private();">_PROMPT2_GRP</a></code>, <code><a href="epydoc.markup.doctest.DoctestColorizer-class.html#_STRING_GRP" onclick="show_private();">_STRING_GRP</a></code> </p></div> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Method Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-MethodDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="markup"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">markup</span>(<span class="sig-arg">self</span>, <span class="sig-arg">s</span>, <span class="sig-arg">tag</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="epydoc.markup.doctest-pysrc.html#HTMLDoctestColorizer.markup">source code</a></span> <br /><span class="codelink"><a href="javascript:void(0);" onclick="toggleCallGraph('call_graph_for_markup_2-div');return false;">call graph</a></span> </td> </tr></table> <div style="display:none" id="call_graph_for_markup_2-div"><center> <table border="0" cellpadding="0" cellspacing="0"> <tr><td><center> <map id="call_graph_for_markup_2" name="call_graph_for_markup_2"> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#colorize_doctest" title="DoctestColorizer.colorize_doctest()" alt="" coords="7,6,295,38" /> <area shape="rect" href="epydoc.markup.doctest.HTMLDoctestColorizer-class.html#markup" title="markup()" alt="" coords="344,34,435,66" /> <area shape="rect" href="epydoc.markup.doctest.DoctestColorizer-class.html#subfunc" title="DoctestColorizer.subfunc()" alt="" coords="37,62,264,94" /> <area shape="rect" href="epydoc.util-module.html#plaintext_to_html" title="util.plaintext_to_html()" alt="" coords="483,34,680,66" /> </map> <img src="call_graph_for_markup_2.gif" alt='' usemap="#call_graph_for_markup_2" ismap="ismap" class="graph-without-title" /> </center></td></tr> <tr><th>Call Graph</th></tr> </table><br /> </center></div> <p>Apply syntax highlighting to a single substring from a doctest block. <code>s</code> is the substring, and <code>tag</code> is the tag that should be applied to the substring. <code>tag</code> will be one of the following strings:</p> <ul> <li> <code>prompt</code> -- the Python PS1 prompt (>>>) </li> <li> <code>more</code> -- the Python PS2 prompt (...) </li> <li> <code>keyword</code> -- a Python keyword (for, if, etc.) </li> <li> <code>builtin</code> -- a Python builtin name (abs, dir, etc.) </li> <li> <code>string</code> -- a string literal </li> <li> <code>comment</code> -- a comment </li> <li> <code>except</code> -- an exception traceback (up to the next >>>) </li> <li> <code>output</code> -- the output from a doctest block. </li> <li> <code>defname</code> -- the name of a function or class defined by a <code>def</code> or <code>class</code> statement. </li> <li> <code>other</code> -- anything else (does *not* include output.) </li> </ul> <dl class="fields"> <dt>Overrides: <a href="epydoc.markup.doctest.DoctestColorizer-class.html#markup">DoctestColorizer.markup</a> <dd><em class="note">(inherited documentation)</em></dd> </dt> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Home link --> <th> <a href="epydoc-module.html">Home</a> </th> <!-- Tree link --> <th> <a href="module-tree.html">Trees</a> </th> <!-- Index link --> <th> <a href="identifier-index.html">Indices</a> </th> <!-- Help link --> <th> <a href="help.html">Help</a> </th> <!-- Project homepage --> <th class="navbar" align="right" width="100%"> <table border="0" cellpadding="0" cellspacing="0"> <tr><th class="navbar" align="center" ><a class="navbar" target="_top" href="http://epydoc.sourceforge.net">epydoc 3.0.1</a></th> </tr></table></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> <a href="epydoc-log.html">Generated by Epydoc 3.0.1 on Wed Jan 30 14:08:29 2008</a> </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>