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

Add support for display_data messages in HTTP outputs #402

Open
teeler opened this issue Sep 4, 2024 · 1 comment
Open

Add support for display_data messages in HTTP outputs #402

teeler opened this issue Sep 4, 2024 · 1 comment

Comments

@teeler
Copy link

teeler commented Sep 4, 2024

Problem

I'd like IPython.display.display to work for all the supported mime types.

Repro:


# GET /
from IPython.display import display
display({"a": 1})

Expected output:

{"a": 1}

Actual output:

(nothing)

Proposed Solution

I think adding a bit of code in the notebook handler that mimics what the notebook frontend does would be sufficient. Two places in particular

Additional context

This seems like a common thing that would need to be done either by javascript frontends or python HTML-serving ones. I haven't seen if theres any code available for reuse but am curious if there is any.

I'm happy to take a stab at implementing a bit of this - PR's OK?

@teeler
Copy link
Author

teeler commented Sep 5, 2024

Seems like https://ipython.readthedocs.io/en/stable/config/integrating.html#custom-methods lists all the mime types that need to be supported

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