executablebooks / sphinx-thebe

A Sphinx extension to convert static code into interactive code cells with Jupyter, Thebe, and Binder.
https://sphinx-thebe.readthedocs.io/en/latest/
MIT License
28 stars 15 forks source link

Make the thebe package URL configurable #24

Open akhmerov opened 3 years ago

akhmerov commented 3 years ago

Description

Right now the thebe package is hard-coded in the codebase:

https://github.com/executablebooks/sphinx-thebe/blob/c036ac41a3b681ed4c2ab3b92edee4a3d2d2e1f0/sphinx_thebe/__init__.py#L12-L16

and loaded here

https://github.com/executablebooks/sphinx-thebe/blob/c036ac41a3b681ed4c2ab3b92edee4a3d2d2e1f0/sphinx_thebe/__init__.py#L66-L71

This should be configurable for the documentation author.

Benefit

  1. Thebe intends to introduce breaking changes (see e.g. https://github.com/executablebooks/thebe/issues/230)
  2. Now it's published under a different name (thebe instead of thebelab)
  3. Some applications may prefer to ship their own version of the js library (e.g. for working offline, etc).
  4. Some smaller/stale packages won't rebuild often. This means their deployed documentation will break.

Implementation

This change would entail adding a new configuration value like thebe_version. It could either be just a version string, or it could be a link to the whole thebe bundle if it's better to manually specify this.

choldgraf commented 3 years ago

Maybe a config called thebe_url ?

choldgraf commented 3 years ago

@akhmerov just FYI the version is now pinned, so I'm scoping this issue just to configurability

https://github.com/executablebooks/sphinx-thebe/blob/master/sphinx_thebe/__init__.py#L134