lux
lux copied to clipboard
Embedding Sphinx Extension
This issue was opened in light of trying to embed lux widgets in the documentation. We've tried a variety of solutions listed below, but none of them were able to either import or embed the widgets.
Our most recent version can be found on this branch, and was based on Altair's documentation. We were able to show code block, but not a chart (might be worth investigating more later on).
We have tried various approaches on this front, along with @westernguy2 and @jrdzha .
- nbsphinx approach:
- Code in our nbsphinx branch (extension to display entire notebook)
- Pandas was able to display correctly
- Save widgets with notebook
- Nbsphinx_widgets_path
-also limited to embedding full ipython notebooks
- jupyter-sphinx approach:
- Code in our jupyter-sphinx branch
- Tried using old version (to use 'jupyter_sphinx.embed_widgets',
.. ipywidgets-display::
)- Seems to be able to build (no errors)
- Shows input, but no output
- limited documentation, so hard to reproduce
- Other ipywidgets that also manually building sphinx ext
- bokeh plot: compiler was specific to bokeh plot, so we decided not to go for this one
- nbinteract: Generate Interactive Web Pages - From Jupyter Notebooks: unable to build custom widgets
- Manually exporting the lux widgets in order to display it on docs (html)
- unable to compile/import lux-widget
As a note for the future, we might need to look into ways that we can make a static rendering of the widget without the need of a Jupyter backend. This requires us to package all the current dependencies into the export. This will also help with embedding to HTML or sharing of Lux widgets.
Item 4 manual export is made possible now with the save_as_html
command from #170