QuantEcon / jupinx

Jupyter + Sphinx Utilities and Tools
https://quantecon.github.io/jupinx/
20 stars 4 forks source link

Rendering Bokeh visualizations in webpages #100

Open MaxGhenis opened 4 years ago

MaxGhenis commented 4 years ago

I've used Jupinx to create this notebook, which includes a Bokeh data visualization that renders correctly in the notebook. However, in the webpage (preview) it doesn't show up. Is there a way to get these interaction visualizations to render in jupinx-built webpages?

Screenshots: Jupyter image

Webpage (locally) image

Webpage (using htmlpreview.github.io) image

mmcky commented 4 years ago

Thanks @MaxGhenis -- these javascript/html type of objects would be nice to have. I'll have a look at how we could pass these richer object types through the template layer when we use nbconvert to build the html.

FYI - Much of the QuantEcon development effort is in the process of moving away from jupinx towards https://github.com/executablebooks/jupyter-book. Having said that we will continue to maintain jupinx in the short term but we don't really have the resources to add new features to jupinx. I'll see if there might be a quick fix for this though (cc: @AakashGfude)

https://jupyterbook.org/intro.html

MaxGhenis commented 4 years ago

Thanks @mmcky, this is good to know. jupyter-book looks cool, would you recommend users try that instead of jupinx? I just started with jupinx a couple days ago, and am generally looking for a way to integrate Jupyter notebook examples into my Python packages, including testing them. Does jupyter-book do that, or if not is there another tool than jupinx you'd suggest?

mmcky commented 4 years ago

I guess it depends to what you'd like to use as your source files? The use case for jupinx is mainly to cater to those wanting to build notebooks or collections of notebooks from rst source files. It also bundles in the ability to execute, build websites, do coverage testing, and generate pdf files -- but they are extensions to its core purpose.

integrate Jupyter notebook examples into my Python packages

The jupyter-book project is more about building books / documentation sites / etc. It also introduces a new syntax that is a hybrid of markdown and rst by introducing roles and directives to markdown -- known as myst. However rst and ipynb can also be used as a source files as sphinx is used under the hood to compile.

jupinx + sphinxcontrib-jupyter won't be going away anytime soon so if it does what you need it to do then that is great but jupyter-book will be more feature rich soon and is developed by a much larger community.