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

Thebe integration: Modify sources #443

Open
Tracked by #1270
HelgeGehring opened this issue Jun 27, 2023 · 12 comments
Open
Tracked by #1270

Thebe integration: Modify sources #443

HelgeGehring opened this issue Jun 27, 2023 · 12 comments
Assignees
Labels
story Feature request or idea to improve mystjs Thebe Integrating Jupyter through Thebe

Comments

@HelgeGehring
Copy link

Which area is this feature request for?

Website User Interface

Describe the feature you'd like to request

Using jupyter-book it is possible to modify the source code after activating the thebe integration. Using mystjs, it seems that I can run the examples, but not modify them (which takes away the greatest advantage of thebe)

Describe the solution you'd like

Would there be a solution to change the source code fields to edit fields like in jupyter-book once "live code" is clicked?

Describe alternatives you've considered

No response

@HelgeGehring HelgeGehring added the story Feature request or idea to improve mystjs label Jun 27, 2023
@welcome
Copy link

welcome bot commented Jun 27, 2023

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@rowanc1
Copy link
Collaborator

rowanc1 commented Jun 28, 2023

Thanks @HelgeGehring for the feedback! Agree completely. :) Working hard on getting there!!

The immediate next step we are working on is to enable being able to import a figure from a notebook into an article:

This is requiring quite a bit of rewiring of thebe in how it works with the theme, and how it keeps track of active kernels. I think that the editing is likely the next step in thebe support -- thoughts on that @stevejpurves?

@HelgeGehring
Copy link
Author

Sounds great! :)

Thanks a lot!

@HelgeGehring
Copy link
Author

Yay, the first step seems to be done 🥳

Would you have a rough idea when the editing becomes a feature? This is the one thing holding me back from moving over from jupyterbook :)

Thanks a lot for the great project! 😄

@stevejpurves stevejpurves self-assigned this Aug 8, 2023
@simbilod
Copy link

+1 this would be very useful!

@stevejpurves
Copy link
Contributor

@HelgeGehring thanks for the question - we're refining how thebe integrates with the base myst-theme packages and components - where there is some flakiness and edge case failures still to work though.

For example, around ipywidgets stability and how interactive outputs integrate into markdown documents -- e.g. for now that still requires power on + run, and trickily the current structure makes it difficult to do that with one click! So i think we'll need to do another pass on improving the code structure before adding more features like codemirrior + editing.

I'd like to think that we can get to it in the next couple of months though!

@HelgeGehring
Copy link
Author

Sounds great, thanks a lot!

For starting I'd already be happy to just edit the example and get new non-interactive output.
To me it seems, that the current version could already do that, the only tweak which would need to be done is automatically replacing the textview by an textedit?
I'd guess that'd be enough for me to switch over and then happily see new features being added :)

One other minor thing I'm thinking of (I can make a separate issue):

  • It would be great to have notebooks re-run with different parameters (i.e. one variable I set in the very beginning).
    Sometimes it's handy to have the same notebook run and see the output of each cell, but see the effect of one variable on all the cells. (More precisely, instead of copying a notebook and running changing just one line, I'd be super happy to have a way to set which variables I'd like to try and have the build command building all three variants of the notebook). I'd be grateful for any advice on how to achieve this :)

Besides, thanks again for the great project!

@HelgeGehring
Copy link
Author

@rowanc1 @stevejpurves
Just wanted to ask if you have any update on this :)
I'd be super happy to switch to mystmd and I think this is the last blocker for me 😄
Thanks a lot for the great project!

@lucasgrjn
Copy link

Hey @rowanc1 @stevejpurves !

Have you any update on this feature? I would really like to also use it in one of my project :)

(Also congrats for mystmd!)

@stevejpurves
Copy link
Contributor

The hesitance here is that the state management of notebook execution in myst-theme is essentially entwined with the react render state. There are already some undesirable effects and edge cases going on that need to be addressed and it's likely that these might be worse if we get into editable cells.

So there are two options; wait for a refactor and introduce editing after we have better state management in place -- or -- drop editing in as-is and see how it behaves, perhaps as an opt-in beta feature and then fix as we go?

@HelgeGehring
Copy link
Author

HelgeGehring commented Mar 15, 2024

Hmm, that sounds like an annoying problem @stevejpurves :/ any rough idea when we could hope for a refactor?
And when do these undesirable effects appear? For interactive content? Or what doesn't work right now?

Yeah, would be great to just give it a try and see what happens if we drop it in :)
Mystmd looks amazing, and I'd be super happy to give it a try :) I really like citing things by just using the doi instead of providing a bib file! Also the integration with pyodide is really nice!

@stevejpurves
Copy link
Contributor

The effects are intermittent and race condition like, so definitely annoying. I hit them when trying to execute a notebook "quickly" after the session has started, so hit the power button and play close together, the effect is that the cells do not execute but the spinners run. There are similar effects occasionally when navigating that need page refreshes to fix. So the issues are not that huge, but you can see the hesitating to build on that foundation.

If we try just dropping something simple in, I think there will be more feature requests pretty quickly :) to extend basic editing but maybe that helps push things along. Timing wise, 🤔 thinking...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
story Feature request or idea to improve mystjs Thebe Integrating Jupyter through Thebe
Projects
None yet
Development

No branches or pull requests

5 participants