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

Investigate more immersive integration of interactive API examples, inspired by sphinx-thebe #242

Open
agriyakhetarpal opened this issue Dec 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@agriyakhetarpal
Copy link
Member

Problem

The TryExamples directive currently reveals an iframe from a "Try it" button to showcase notebooks for a Pyodide kernel, which then displays the Notebook interface containing the example formatted in a cell with surrounding Markdown. While it is completely functional—of course—it is not "immersive" and does not fully integrate with the rest of the surrounding elements on the docs page.

Proposed Solution

Enable connecting to a Xeus/Pyodide kernel more seamlessly, in a way that is less intrusive on the page, by reworking the UI similar to this example from the sphinx-thebe documentation: https://sphinx-thebe.readthedocs.io/en/latest/use.html#an-example.

It can be used as a "MyST-NB" adapter of sorts as well, so that one does not need to open a new tab to run a notebook embedded as HTML separately – they can just connect to a kernel (which, by the way, is a single one for all cells on the page, see #2), and magically spring up the notebook cells into interactivity without leaving the page.

This would require a significant amount of work, around:

  • enabling just one kernel per page (if notebooks are to be supported, otherwise no)
  • modifying the JupyterLite UI upstream or disabling as many visual elements as possible, so that just a minimal code cell remains (and is editable)
  • being able to "communicate" between WASM kernels and the output in the same way as Binder does

Additional context

xref: jupyterlite/jupyterlite#148 and #63

@agriyakhetarpal agriyakhetarpal added the enhancement New feature or request label Dec 23, 2024
@jtpio
Copy link
Member

jtpio commented Dec 24, 2024

Of note, there is also thebe-lite, with some docs here: https://mystmd.org/thebe/quickstart-lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants