Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use sphinx to render docstring in contextual help #8581

Open
ericpre opened this issue Jun 17, 2020 · 7 comments
Open

Use sphinx to render docstring in contextual help #8581

ericpre opened this issue Jun 17, 2020 · 7 comments

Comments

@ericpre
Copy link

ericpre commented Jun 17, 2020

Problem

Rendering docstring using the numpydoc formatting could be significantly better using sphinx. For example, spyder "Help" panel is more readable particularly when the docstring contain latex. This should be useful to render cross-referencing to python objects.

For example, the contextual help of:

import sympy
sympy.atan2

Jupyter lab contextual help:
image

Spyder help panel:
image

Proposed Solution

Use sphinx to render contextual help.

Additional context

See for example spyder help panel: https://docs.spyder-ide.org/help.html#understanding-help-modes

@mbellitti
Copy link

Is there any progress on this? I tried using docrepr as explained here, but the results are not very consistent (sometimes it shows a function's source rather than the rendered docstring), and it looks docrepr was last updated almost two years ago.

Rendering the docstring in the same way Spyder does it would be a significant quality of life improvement. I'm happy to help, is there something I can do?

@joelostblom
Copy link
Contributor

joelostblom commented Jul 12, 2023

@mbellitti
Copy link

Thank you for the links. I saw someone mention writing a server extension, do you know if there's any project like that being developed?

@joelostblom
Copy link
Contributor

Hmm, I am not aware of any at the moment

@krassowski
Copy link
Member

Well, there is https://github.com/jupyter/papyri and https://github.com/carreau/papyri-lab - it does not hook into the context help renderer yet it seems but it would certainly be possible.

@joelostblom
Copy link
Contributor

Wow that's cool, I had totally missed that this was in development. Thank you @Carreau for working on it, I really enjoyed reading your blog post as well!

@krassowski
Copy link
Member

New thing https://github.com/krassowski/ipython-markdown-inspector makes IPython return Markdown-formatted docstrings. It requires IPython 8.21 and will be even better with 8.22 (once released).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants