[IPython-dev] ipython sphinx directive

John Hunter jdh2358@gmail....
Sun Dec 13 08:36:39 CST 2009


On Sun, Dec 13, 2009 at 4:42 AM, VáclavŠmilauer <eudoxos@arcig.cz> wrote:
>> > A demo document is included below, which is rendered at
>> > http://matplotlib.sourceforge.net/ipymode/_build/html/ipy_demo.html,
>> > and the ipython_directive is attached.
>
> Hi, I found your ipython_directive in your previous posts and use it very
> successfully for documenting yade (https://www.yade-dem.org/sphinx/).
> Thanks a lot!!
>
> Is the current version somewhere around (it is not in ipython bzr branch)?
> I would like to send some patches, concerning in particular custom
> in/out prompts [*] (the out prompt doesn't work, as you see in the output,
> btw), a way to (dis)allow commands that raise exception (so that sphinx
> aborts if there is exception from ipython code where it is not expected)
> and, finally, to have the possiblity of "raw" input (without the input
> prompt, and just input lines).

The directive does not yet live in any public repo, but we can/should
correct that fairly easily.  I can add it to the mpl sphinxext for the
time being, or would you rather it live in ipython bzr Fernando?  Like
pylab, it is currently a hybrid monster between ipython and pyplot.
It does need some cleaning -- primarily we should factor out the pure
ipython directive from the part that is mpl/pyplot aware, or at least
set it up so it can run w/o mpl for folks who just want to the ipython
part.   The current version is also just for the 0.10 line and not
ipython HEAD, so we need to figure out what branch it should be on,
and eventually port it to the HEAD (or whatever it is you bzr types
call the current development branch)

Fernando and I made a few minor fixes and cleanups to this since I
last posted it -- eg magics like 'cd' now work and there are some
hacks to make @savefig work even as you change your current directory
in ipython (@savefig always saves to _static).  If you could
incorporate your changes into the latest and then post a patch, that
would be most helpful.

I'm pretty sure the output prompt is formatted properly in the version
I posted and the one attached here, so I'd like to clear up that
problem before integrating your work.  I knew someone would want a
custom prompt -- I just didn't expect it so soon :-)


Finally I should update sampledoc to discuss and document this, so it
gets wider attention:

http://matplotlib.sourceforge.net/sampledoc/

Thanks,
JDH
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipython_directive.py
Type: text/x-python
Size: 14585 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-dev/attachments/20091213/493e41e8/attachment.py 


More information about the IPython-dev mailing list