Skip to content

Commit 5006c6a

Browse files
authored
Merge pull request #53 from hugokerstens/thebelab-support
Add thebelab support
2 parents 3f48345 + 4cf2aec commit 5006c6a

File tree

6 files changed

+453
-26
lines changed

6 files changed

+453
-26
lines changed

doc/source/conf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@
2828
]
2929

3030
html_theme = 'alabaster'
31+
32+
jupyter_sphinx_thebelab_config = {
33+
"binderOptions": {
34+
"repo": "jupyter-widgets/jupyter-sphinx",
35+
},
36+
}

doc/source/index.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,31 @@ to ``jupyter-execute``::
8383
when they are included with Sphinx autodoc.
8484

8585

86+
Thebelab support
87+
----------------
88+
89+
To turn on `thebelab <https://thebelab.readthedocs.io/>`_, specify its configuration directly
90+
in ``conf.py``:
91+
92+
.. code-block:: python
93+
94+
jupyter_sphinx_thebelab_config = {
95+
'requestKernel': True,
96+
'binderOptions': {
97+
'repo': "binder-examples/requirements",
98+
},
99+
}
100+
101+
With this configuration, thebelab is activated with a button click:
102+
103+
.. thebe-button:: Activate Thebelab
104+
105+
By default the button is added at the end of the document, but it may also be inserted anywhere using
106+
107+
.. code-block:: ReST
108+
109+
.. thebe-button:: Optional title
110+
86111
Directive options
87112
-----------------
88113
You may choose to hide the code of a cell, but keep its output visible using ``:hide-code:``::

0 commit comments

Comments
 (0)