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 MDX support to the GUI API #73

Merged
merged 11 commits into from
Aug 8, 2023
Merged

Add MDX support to the GUI API #73

merged 11 commits into from
Aug 8, 2023

Conversation

jonahbedouch
Copy link
Contributor

Some of the code here is probably a bit weird, but this PR provides the ability for Viser to accept MDX from Python that gets rendered in real time on the client.

It does so with the interface:

server.add_gui_markdown(markdown: str, images: Optional[Dict[str, onp.ndarray]]) -> GuiMarkdownHandle

Where markdown is the provided mdx and images is an optional dictionary of named local images that the mdx can draw from (alongside any remote images).

Example 14 highlights an actual use case of how this works and the results, since the outcome is a little large for a screenshot.

@brentyi brentyi enabled auto-merge (squash) August 8, 2023 09:39
@brentyi brentyi merged commit 046b813 into main Aug 8, 2023
11 checks passed
@brentyi brentyi deleted the jonah/mdx branch August 8, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants