-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: Add replite console to the users docs #22634
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
Conversation
b29a69d
to
ac6e304
Compare
Turning this into draft until it actually works |
ac6e304
to
60f8ca9
Compare
🤩 🤩 🤩
They're very difficult to build locally - also takes a long time to build. In general I'd say it's not worth it. But if you do want to (and are on linux) then I found I was able to successfully do it by following this dockerfile: https://github.com/matplotlib/mpl-docker/blob/master/Dockerfile (or I usppose you could use that dockerfile) |
Thanks @ianhi! I'll see if I'm more lucky with this dockerfile, otherwise I'll rely on the CI |
ooooh - @martinRenou you know what, a PR to sphinx-gallery enabling automatically interactive examples would probably be the most high impact jupyterlite docs PR you could make. Because then all https://matplotlib.org/stable/gallery/index would suddenly be runnable in the browser. There would also be a much shorter feedback cycle as the docs builds wouldn't take nearly as long. If you are interested in that - or in adding it to an existing (but smaller) gallery you feel free to try it out on https://github.com/ianhi/mpl-point-clicker where the docs build is significantly faster |
See also: sphinx-gallery/sphinx-gallery#927 |
Building this locally and using
It looks like the issue is that the what ever is formatting the URL expects to be at the top level, but is actually a level down. |
Changing the URL in the iframe to |
@tacaswell it should be possible to pass multiple |
@jtpio is there a way to keep the line breaks so that the whole code is in just one cell? |
Normally it can be encoded and contain new lines. For example with the demo site: |
Thanks! I'll push a PR fixing jupyterlite-sphinx's replite directive |
75038a3
to
a2343cb
Compare
I fail to understand why the CI is failing to build de docs. Though I can reproduce locally, |
There are many warnings that look like:
It looks like repllite is dropping some additional files in places that is confusing sphinx? |
Is it possible to add ipympl to the jupyterlite environment here? This could easily be many peoples first interaction with matplotlib and it would be a great opportunity to reinforce the fact that matplotlib is in fact interactive. Thinking about this this because I saw: https://twitter.com/blu3r4d0n/status/1502309909811109888 |
ahh I forgot about that. Maybe until then it would make sense to use retrolite here. How difficult would be it be to switch the directive? |
Not difficult :) We just need to change the directive from To summarize, what's remaining before the PR is working and ready:
|
a2343cb
to
c668955
Compare
What really confuses me is that jupyterlite did not even run yet at the point the warnings are showing up. And those files seems to be more related to the Matplotlib docs than JupyterLite? But the weird thing is that those warnings don't seem to show up in other PRs. |
c668955
to
ce4fa5c
Compare
Outstanding issues: Can the extension be made read-parallel safe (is it already and we just need declare it?)?
There is a veritable wall of errors that look like:
It seems to result in a working website, but (locally) fails the build for me. This seems to add 400K to the main page, but if you click the "try Matplotlib" button it is on the order of 64M and over my local network takes 8-9 s to load! I think we need a warning and note about the size to expect when clicking the button. I think we need to make the "view the gallery" link needs to be way more obvious. I knew it was there and took me few seconds to find it. Launching jupyterlab produces a warning about a git extension and costs about 12M and 10s or so. This probably should also be warned? The notebooks launch with In jupyterlab there are directories full of .ipynb, but at the toplevel there is a mix of .ipynb, rst, and pickles (?!). It seems every time a new notebook is opened another ~50-60M of data is pulled. I'm not sure if this is an inherent problem or the cache being disabled by the dev tools (even if "disable cache" is unchecked?). I'm going to push a rebase. |
2283249
to
0f331a5
Compare
Hi all and to those subscribed to this PR, I've been interested in getting this effort revived for Matplotlib through https://github.com/jupyterlite/jupyterlite-sphinx/releases/tag/v0.18.0 that we've now released today on 13/01/2025. I've read through this thread fully, and I'm happy to share that most of the problems noticed in Here is a table that contains a short summary of relevant discussions and previous requests in the code review above for easy access, and my comments on them:
@martinRenou, I wish to ask if you're still interested in completing this PR? I would love to supersede it, but wished to ask in advance. If yes, no worries, I would be happy to step back and let you complete it. :) Additional comments:
|
Hi @martinRenou, I hope it is fine to ping you again here? Perhaps you missed my comment above or didn't see this PR show up in your notifications – I've been planning to work on this lately and hope to open a new PR to supersede this, and I have a working draft on my fork via agriyakhetarpal#1 that preserves authorship. If you prefer I don't do this, please let me know, and thanks for your work! |
Hi @agriyakhetarpal! First, thanks a ton for your work in jupyterlite-sphinx 🤟🏽, thanks for the detailed comment here, and thanks for taking this PR over! Happy to close this one and have yours replace it 😃 |
🤦♀️ Commented on the wrong PR so gonna move this there, sorry |
Closing as replaced by #29506 |
PR Summary
cc. @ianhi
Add a JupyterLite console to the docs, allowing users to try and play with Matplotlib directly in the documentation
I have not been able to build the docs locally due to some latex issue I'm having. But the CI should allow us to test this :)