jupyterlite / jupyterlite-sphinx

Sphinx extension using JupyterLite to render Notebooks
https://jupyterlite-sphinx.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
67 stars 20 forks source link

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

Open jtpio opened 2 years ago

jtpio commented 2 years ago

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 commented 2 years ago

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

bollwyvl commented 2 years ago

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": {}
    }
jtpio commented 2 years ago

Ah right that would indeed be very convenient!

martinRenou commented 2 years ago

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.

bollwyvl commented 2 years ago

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).