This package provides a Pygments lexer for IPython Console Files. The lexer is published as an entry point and, once installed, Pygments will pick it up automatically.
You can then use the ipython
language with Pygments:
$ pygmentize -l ipython test.ipy
[Or use the standard sphinx import of ipython_console_highlight.py]
In Sphinx documents the lexer is selected with the highlight
directive:
.. highlight:: ipython
Thanks to pygments-openssl project for providing a template [https://github.com/stefanholek/pygments-openssl]
This needs IPython 1.0+ for sphinxext module
Use your favorite installer to install pygments-ipython into the same Python you have installed Pygments. Constructing an egg from repository:
$ git clone https://[email protected]/sanguineturtle/pygments-ipython-console.git $ cd pygments-ipython-console $ python setup.py bdist_egg
For example [change directory to dist/ folder to locate egg file]:
$ easy_install pygments-ipython-console.egg
To verify the installation run:
$ pygmentize -L lexer | grep -i ipy * ipy: IPy session (filenames *.ipy)