jupyter / jupyter-sphinx

Sphinx extension for rendering of Jupyter interactive widgets.
https://jupyter-sphinx.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
187 stars 65 forks source link

thebelab broken #165

Open akhmerov opened 4 years ago

akhmerov commented 4 years ago

This is from our docs.

image

Maybe it's time to switch to sphinx-thebe

martinRenou commented 2 years ago

I was able to get a combination of jupyter-sphinx and sphinx-thebe working nicely with the following conf.py:

extensions = [
    ...
    'jupyter_sphinx',
    'sphinx_thebe'
]

thebe_config = {
    "selector": "div.jupyter_cell",
    "selector_output": "div.cell_output",
    "repository_url": "https://github.com/bqplot/bqplot",
    "repository_branch": "stable",
}

And the following rst:


.. thebe-button:: Click me!

.. jupyter-execute::

    import numpy as np
    from bqplot import pyplot as plt

    plt.figure(1, title="Line Chart")
    np.random.seed(0)
    n = 200
    x = np.linspace(0.0, 10.0, n)
    y = np.cumsum(np.random.randn(n))
    plt.plot(x, y)
    plt.show()

And this is the result:

https://user-images.githubusercontent.com/21197331/146774032-1a452a8f-5abc-4048-a6c2-4ceb70feb7cf.mp4