|
From: Michael D. <md...@st...> - 2008-05-23 14:57:00
|
Michael Droettboom wrote:
> Secondly, the ipython console sessions aren't getting syntax highlighted
> -- it would be nice if they did, particularly to indicate input vs.
> output. I'll volunteer to look into this -- I've done some pygments
> customization work in the past and maybe it won't be too difficult.
>
I just committed support for this on the trunk. The usage is not
automatic. The reST code must specifically request it using the
..sourcecode directive:
.. sourcecode:: ipython
In [101]: ax.lines[0]
Out[101]: <matplotlib.lines.Line2D instance at 0x19a95710>
In [102]: line
Out[102]: <matplotlib.lines.Line2D instance at 0x19a95710>
Making this automatic would have required monkey-patching Sphinx --
there doesn't seem to be an API to extend its algorithm to automatically
select a syntax highlighter, as I suppose this requirement is somewhat
obscure.
Cheers,
Mike
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|