jupyterlite-sphinx icon indicating copy to clipboard operation
jupyterlite-sphinx copied to clipboard

Add a copy pastable snippet to deploy a JupyterLab extension to RTD with JupyterLite

Open jtpio opened this issue 4 years ago • 5 comments

Problem

There is already a section in the docs to deploy JupyterLite to ReadTheDocs: https://jupyterlite.readthedocs.io/en/latest/deploying.html#readthedocs

However the config in the main repo might feel a bit intimidating and a couple of things are specific to the jupyterlite repo.

Suggested Improvement

We could add a simpler config snippet that would be simpler to grasp. And mention the CONDA_USES_MAMBA flag for a nice speedup.

That way folks could easily deploy demos and previews of their (pure frontend) JupyterLab extensions (not necessarily related to JupyterLite) on ReadTheDocs, which might be faster than waiting for a Binder to build and launch.

jtpio avatar Oct 04 '21 08:10 jtpio

This also "enforces" having docs which is also nice. Maybe that docs part could go to the upstream cookiecutter: https://github.com/jupyterlab/extension-cookiecutter-ts

jtpio avatar Oct 04 '21 08:10 jtpio

Given the prevalence of this case (and the rapidly-rising complexity of a "simple" docs site :blush:), that snippet might best be wrapped into https://github.com/jupyterlite/jupyterlite/issues/149 and look something like:

  • add sphinx-jupyterlite to your docs/requirements.txt
  • in conf.py, add
extensions = [
   "sphinx_jupyterlite",
]
jupyter_lite_config = {           # see configuration options
   "federated_extensions": {}
}

bollwyvl avatar Oct 04 '21 15:10 bollwyvl

Ah right that would indeed be very convenient!

jtpio avatar Oct 05 '21 12:10 jtpio

That part:

jupyter_lite_config = {           # see configuration options
   "federated_extensions": {}
}

is a nice idea! Currently jupyterlite-sphinx expects the jupyterlite_config config option to point to an external json file, but that could be changed to be a Python dictionary.

martinRenou avatar Mar 14 '22 08:03 martinRenou

Yea maybe jupyter_lite_config being a path or a dict makes sense. There are a lot of paths in there, so that would need to be formalized (e.g. resolve all of them or something).

There is also the run-time jupyter-lite.json settings (e.g. appName) that one might want to set... but maybe this could also be configured (and validated) upstream in the traitlets side of the house. These are often named very similarly to the build settings, but need to be very precisely-managed URLs to work properly... and can be customized per app. Maybe we need some more ways to customize sub-apps' from the main app's runtime settings (also upstream).

bollwyvl avatar Mar 14 '22 13:03 bollwyvl