IPython Documentation

Table Of Contents

Previous topic

Module: qt.util

Next topic

Module: sphinxext.ipython_directive

This Page

Module: sphinxext.ipython_console_highlighting

reST directive for syntax-highlighting ipython interactive sessions.

XXX - See what improvements can be made based on the new (as of Sept 2009) ‘pycon’ lexer for the python console. At the very least it will give better highlighted tracebacks.

1 Class

class IPython.sphinxext.ipython_console_highlighting.IPythonConsoleLexer(**options)

Bases: pygments.lexer.Lexer

For IPython console output or doctests, such as:

In [1]: a = 'foo'

In [2]: a
Out[2]: 'foo'

In [3]: print a

In [4]: 1 / 0


  • Tracebacks are not currently supported.
  • It assumes the default IPython prompts, not customized ones.

1 Function


Setup as a sphinx extension.