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 display_mermaid function #15725

Closed
dhirschfeld opened this issue Feb 1, 2024 · 3 comments
Closed

Add display_mermaid function #15725

dhirschfeld opened this issue Feb 1, 2024 · 3 comments
Labels
enhancement pkg:mermaid status:Needs Triage Applied to new issues that need triage

Comments

@dhirschfeld
Copy link
Member

Problem

I'm testing the new Mermaid fenced-blocks on 4.1.0rc0 and it's pretty great! ❤️🚀

What I'd like to do is to display programmatically generated Mermaid diagrams in JupyterLab.

In the same way I can pass an HTML string to display_html and have it be rendered, I'd like to be able to pass a string representing a Mermaid diagram to display_mermaid and have it be rendered.

Proposed Solution

Add a display_mermaid(diagram: str) function which rendered the provided diagram as a Mermaid diagram

Additional context

All the display_* functions are in IPython.display so if the IPython repo is a better location for this I'm happy to transfer it there.

I opened it here as I suspect the display function (potentially display.DisplayObject class) might need support in JupyterLab to work properly.

@dhirschfeld dhirschfeld added enhancement status:Needs Triage Applied to new issues that need triage labels Feb 1, 2024
@krassowski
Copy link
Member

Sounds like a good idea, though yes, this is very much IPython enhancement request. Feel free to open a PR against IPython and I will happily review it.

@afonit
Copy link

afonit commented Feb 1, 2024

@dhirschfeld,
I noticed this had not been created yet in the ipython issue tracker, so I went ahead and setup an issue to get the ball rolling:
ipython/ipython#14319

@JasonWeill
Copy link
Contributor

Closing in favor of ipython/ipython#14319.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pkg:mermaid status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

4 participants