<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Module: nbconvert.filters.ansi — IPython 2.3.0 documentation</title> <link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../', VERSION: '2.3.0', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script> <link rel="top" title="IPython 2.3.0 documentation" href="../../index.html" /> <link rel="up" title="The IPython API" href="../index.html" /> <link rel="next" title="Module: nbconvert.filters.citation" href="IPython.nbconvert.filters.citation.html" /> <link rel="prev" title="Module: nbconvert.exporters.templateexporter" href="IPython.nbconvert.exporters.templateexporter.html" /> </head> <body> <div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px"> <a href="http://ipython.org/"><img src="../../_static/logo.png" border="0" alt="IPython Documentation"/></a> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="IPython.nbconvert.filters.citation.html" title="Module: nbconvert.filters.citation" accesskey="N">next</a> |</li> <li class="right" > <a href="IPython.nbconvert.exporters.templateexporter.html" title="Module: nbconvert.exporters.templateexporter" accesskey="P">previous</a> |</li> <li><a href="http://ipython.org">home</a>| </li> <li><a href="../../search.html">search</a>| </li> <li><a href="../../index.html">documentation </a> »</li> <li><a href="../index.html" accesskey="U">The IPython API</a> »</li> </ul> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../../index.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Module: <tt class="docutils literal"><span class="pre">nbconvert.filters.ansi</span></tt></a><ul> <li><a class="reference internal" href="#functions">4 Functions</a></li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="IPython.nbconvert.exporters.templateexporter.html" title="previous chapter">Module: <tt class="docutils literal"><span class="pre">nbconvert.exporters.templateexporter</span></tt></a></p> <h4>Next topic</h4> <p class="topless"><a href="IPython.nbconvert.filters.citation.html" title="next chapter">Module: <tt class="docutils literal"><span class="pre">nbconvert.filters.citation</span></tt></a></p> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../_sources/api/generated/IPython.nbconvert.filters.ansi.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-IPython.nbconvert.filters.ansi"> <span id="module-nbconvert-filters-ansi"></span><h1>Module: <tt class="xref py py-mod docutils literal"><span class="pre">nbconvert.filters.ansi</span></tt><a class="headerlink" href="#module-IPython.nbconvert.filters.ansi" title="Permalink to this headline">¶</a></h1> <p>Filters for processing ANSI colors within Jinja templates.</p> <div class="section" id="functions"> <h2>4 Functions<a class="headerlink" href="#functions" title="Permalink to this headline">¶</a></h2> <dl class="function"> <dt id="IPython.nbconvert.filters.ansi.strip_ansi"> <tt class="descclassname">IPython.nbconvert.filters.ansi.</tt><tt class="descname">strip_ansi</tt><big>(</big><em>source</em><big>)</big><a class="headerlink" href="#IPython.nbconvert.filters.ansi.strip_ansi" title="Permalink to this definition">¶</a></dt> <dd><p>Remove ansi from text</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>source</strong> : str</p> <blockquote class="last"> <div><p>Source to remove the ansi from</p> </div></blockquote> </td> </tr> </tbody> </table> </dd></dl> <dl class="function"> <dt id="IPython.nbconvert.filters.ansi.ansi2html"> <tt class="descclassname">IPython.nbconvert.filters.ansi.</tt><tt class="descname">ansi2html</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#IPython.nbconvert.filters.ansi.ansi2html" title="Permalink to this definition">¶</a></dt> <dd><p>Conver ansi colors to html colors.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>text</strong> : str</p> <blockquote class="last"> <div><p>Text containing ansi colors to convert to html</p> </div></blockquote> </td> </tr> </tbody> </table> </dd></dl> <dl class="function"> <dt id="IPython.nbconvert.filters.ansi.single_ansi2latex"> <tt class="descclassname">IPython.nbconvert.filters.ansi.</tt><tt class="descname">single_ansi2latex</tt><big>(</big><em>code</em><big>)</big><a class="headerlink" href="#IPython.nbconvert.filters.ansi.single_ansi2latex" title="Permalink to this definition">¶</a></dt> <dd><p>Converts single ansi markup to latex format.</p> <p>Return latex code and number of open brackets.</p> <p>Accepts codes like ‘[1;32m’ (bold, red) and the short form ‘[32m’ (red)</p> <p>Colors are matched to those defined in coloransi, which defines colors using the 0, 1 (bold) and 5 (blinking) styles. Styles 1 and 5 are interpreted as bold. All other styles are mapped to 0. Note that in coloransi, a style of 1 does not just mean bold; for example, Brown is “0;33”, but Yellow is “1;33”. An empty string is returned for unrecognised codes and the “reset” code ‘[m’.</p> </dd></dl> <dl class="function"> <dt id="IPython.nbconvert.filters.ansi.ansi2latex"> <tt class="descclassname">IPython.nbconvert.filters.ansi.</tt><tt class="descname">ansi2latex</tt><big>(</big><em>text</em><big>)</big><a class="headerlink" href="#IPython.nbconvert.filters.ansi.ansi2latex" title="Permalink to this definition">¶</a></dt> <dd><p>Converts ansi formated text to latex version</p> <p>based on <a class="reference external" href="https://bitbucket.org/birkenfeld/sphinx-contrib/ansi.py">https://bitbucket.org/birkenfeld/sphinx-contrib/ansi.py</a></p> </dd></dl> </div> </div> </div> </div> </div> <div class="clearer"></div> </div> <div class="related"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="IPython.nbconvert.filters.citation.html" title="Module: nbconvert.filters.citation" >next</a> |</li> <li class="right" > <a href="IPython.nbconvert.exporters.templateexporter.html" title="Module: nbconvert.exporters.templateexporter" >previous</a> |</li> <li><a href="http://ipython.org">home</a>| </li> <li><a href="../../search.html">search</a>| </li> <li><a href="../../index.html">documentation </a> »</li> <li><a href="../index.html" >The IPython API</a> »</li> </ul> </div> <div class="footer"> © Copyright The IPython Development Team. Last updated on Sep 02, 2015. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. </div> </body> </html>