Open MarcSkovMadsen opened 1 year ago
Just popping in to say that at the SG end I think https://github.com/sphinx-gallery/sphinx-gallery/pull/1138 was close to being complete so @MarcSkovMadsen you could probably take it over and push it over the finish line if you want. I could fix the merge conflicts quickly if it would help.
In https://discourse.holoviz.org/t/how-to-use-sphinx-gallery-with-panel/6035 pkrull asks for help using Panel with sphinx-gallery.
I think it could be quite powerful to support. It could even be used for the Panel or awesome-panel sites? It builds much faster than the notebooks in Panel !
All it takes to support
sphinx-gallery
is really a_repr_html_
method on Panel objects. For example something that returns an iframe.Proof of concept
For example by adding the below to the sphinx
conf.py
file you will get it workingThis is how it looks
Repository
A working repository is here https://github.com/MarcSkovMadsen/sphinx-gallery-panel-example
Todo
Some things that could be done to improve things
resizeIframe
more robust. With the Plotly example sometimes theiframe.contentWindow.document.body.scrollHeight
is ~500px and sometimes ~1500px. That is why I've introduced themax_height
parameter..save
orpanel convert
to pyodide to generate thehtml
panel
before each example https://sphinx-gallery.github.io/stable/advanced.html#resetting-before-each-exampleQuestion
How should we support it
_repr_mimebundle_
. See https://github.com/sphinx-gallery/sphinx-gallery/pull/1138