![](https://secure.gravatar.com/avatar/95198572b00e5fbcd97fb5315215bf7a.jpg?s=120&d=mm&r=g)
On Wed, Aug 5, 2009 at 1:49 PM, Emmanuelle Gouillart<emmanuelle.gouillart@normalesup.org> wrote:
One thing that I'm not very happy with the Sphinx output is that copy & paste of the examples is quite difficult, since you get the >>> and ... prompts. This could be avoided with suitable HTML magick.
Maybe the wonderful %doctest_mode magic command of Ipython should be advertised somewhere... I use it all the time since I've discovered the feature, it's awfully convenient :D.
Thanks for answering for me :) Regarding the advertising, I'll be the first to admit we could do better. But in our defense, it's at least documented: http://ipython.scipy.org/doc/stable/html/interactive/tutorial.html?highlight... http://ipython.scipy.org/doc/stable/html/overview.html?highlight=doctest_mod... http://ipython.scipy.org/doc/stable/html/development/overview.html?highlight... http://ipython.scipy.org/doc/stable/html/api/generated/IPython.Magic.html?hi... Maybe ipython should open a twitter account with a tweet-tip (tweetip?) of the day everyday :)
I think such a demo function could be easy to implement: just pick up the doctest lines and run them. I think a IPython extension could easily be written for this: just check what's in the ipy_*.py files under IPython/Extensions and adapt one of them.
There's a ready-made implementation of the doctest pickup in plot_directive.py under numpy/doc/sphinxext.
That's exactly the kind of hints I was looking for, many thanks! I'll have a look at the files you mention to see how it could be done.
And when you finish, send it our way. Operators are standing by to take your patch and your credit card number... :) Take care, f