13

Is there a way to have IPython fully render reStructuredText (for Sphinx) docstrings when you type the following:

help foo 

or:

foo? 

I find it super distracting to try to read help docs in IPython when it shows the raw markup. reST is great for Sphinx documentation, but really clutters up simple help lookups. I can't be alone on this one...?

Google has been no help on this one.

6
  • As far as I know, not yet. Contributions are welcome - ask on mailing lists or IRC about where to start. Commented Jan 24, 2012 at 20:53
  • One way you could add the feature is to render the docstring to HTML and then parse and colorize (or just print the text) the output. Commented Mar 4, 2012 at 20:21
  • There's also a text builder for Sphinx, that might be easier than using HTML. Commented Mar 21, 2012 at 17:03
  • 1
    I agree, viewing sphinx docstrings in ipython is not really human readable. I have tried using "Consolidated Fields" as a compromise: viewing docstrings in interpreter is better, but some of Sphinx's nice features are lost. Commented Jul 29, 2013 at 18:54
  • 1
    Thank you for the link- very encouraging. I think Brian Granger said it best: "Personally, if the notebook became able to handle markdown+latex docstrings, I would never user reST for any new project." I'm already using Markdown in docstrings instead of Sphinx, as I see a few projects aiming to build API documentation from docstrings. This, I think, is the only thing for which I currently need Sphinx. Commented May 19, 2014 at 17:20

1 Answer 1

2

I don't think it is possible in IPython, but have a look at Spyder: You can open an IPython console from within the IDE. Docstrings are rendered as HTML.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.