Open psychemedia opened 3 years ago
Would #25 address this need?
@akhmerov Ah, so is that suggesting just dumping thebe_config
into <script type="text/x-thebe-config">
?
So to backtrack from that, some way would need to setup the thebe_config
structure correctly.
I also note for even more generality, it would be worth considering a case where ThebeLab might also support Jupyterlite (eg https://github.com/executablebooks/thebe/issues/412 .
+1 to this being useful!
Currently, thebe is hardwired to connect to a kernel launched from a BinderHub server using the following templated config as per https://github.com/executablebooks/sphinx-thebe/blob/44ae793880eba585120cfea0af87012b6abf21fc/sphinx_thebe/__init__.py#L94:
It would be useful to be able to specify a local connection to an already running server rather than a BinderHub connection, eg as per https://github.com/executablebooks/jupyter-book/issues/199 and https://github.com/executablebooks/jupyter-book/issues/1206.
This would require a template of the form (untested - {} may be messed up...):
to give a config such as the following for a local server run as
jupyter notebook --NotebookApp.token=test-secret --NotebookApp.allow_origin='http://localhost:8888'
As for settings in Jupyter book, maybe add something like the following to
jupyter_book/config_schema.json
:with default set via
jupyter_book/default_config.yml
as per something like:In a default setup, as per above, these would then be set as per:
Some logic would then be required to determine which thebe template to use based on relative settings of
binderhub_url
andthebe_local_url
.The Launching from MyBinder message in
sphinx_thebe/_static/sphinx-thebe.js
would also need updating as appropriate.It would possibly be neater to have a Jupyter Book setting
thebe: binderhub | server | none
rather than true false and thenthebe_server_url
would work equally for BinderHub. But that could break backwards compatible config files.I've started trying to explore this route by mnaully editing Jupyter Book HTML pages in the context of a jupyter-server-proxied Jupyter Book. Notes here: https://github.com/ouseful-testing/jupyter-book-server-proxy