Get help from the marimo community

Updated 2 weeks ago

Embedding notebook in JupyterBook

I am embedding a notebook produced by marimo export html in a JupyterBook project. How can I make the notebook respect the dark/light theme of the book?
M
l
A
14 comments
  • are you embedding the html in the same DOM as the notebook? or embedding in an iframe?
  • what is the config in your marimo config show for display.theme? setting to system might help
thanks for the quick response @Myles Scolnick ! Currently, I am using:

Plain Text
{raw} html
:file: static/tutorial.html

Setting to display.theme to system does not help, unfortunately.

No worries though, I think I will probably just link out to a separate window, rather than embedding in the book
@lucascolley โ€” if the jupyterbook is public, Iโ€™d love to see it when itโ€™s ready! ๐Ÿ™‚
change of plan, I'm now looking at including the output of marimo export ipynb in the jupyterbook, and including a link out to the interactive marimo app
I'm working on https://static.marimo.app/static/marray-qs5t - currently blocked by the version of NumPy on Pyodide I think
it seems that sphinx (or at least the book theme) doesn't have any good ways to include separately generated html as a page
you might be able to do import micropip; await.micropip.install("numpy==<version>") before your numpy import to get the correct version (assuming there is a pyodide-compatible built of it)
I've also got it to work with sandbox locally - can I get sandbox notebooks on marimo.app ?
I don't think that works for packages with non-pure python wheels
I saw your request. Do you know if numpy has been built? If I implemented the sandbox request, it will only call to micropip so may not work for numpy
If numpy has been built but lives elsewhere, I think we can patch the pyodide lock file with the new version
it sounds like it can be built, but I'm not sure how easy that is outside of the pyodide tree
This might be a good question for the Pyodide team? I wonder if they have thought about this problem. They are pretty responsive to GitHub discussions, and you can tag me and Myles
yeah, I asked on the pyodide discord
Add a reply
Sign up and join the conversation on Discord