this series of notebooks is for playing with execution modes in jupyter book
2 possible sets of options:
run
mystwith or without--execute
when present, this runs the notebook at build-time
apparently this applies to all notebooks thoughenable an embedded JupyterLite kernel, which then allows to run the notebook in the browser, at read-time
pros and cons:
1/1 when both are enabled, apparently the build-time execution is done first and the run buttons don’t do anything
1/0 if run at build-time, outputs are readily available without any manipulation
0/1 but when interactivity is needed, it’s cool to rely on the embedded kernel so that dynamic behaviour like widgets or nbautoeval can be used
0/0 nothing is executed, useful for a small number of static content pieces, having them ig overhead either
recommended setup¶
build the project with the
--executeflag to have outputs available at build-timein some specific notebooks, turn off build-time execution and enable thebe + jupyterlite so that users can re-execute the notebook in the browser
see next notebook for an example of how to do that
prerequisites¶
as far as I can tell what is required is this (double check in the GH actions and myst.yml)
install NPM modules in the build environment¶
npm install -g mystmd thebe-core thebe thebe-liteenable jupyterlite for myst¶
in myst.yml, add
jupyter:
lite: truethat is to say project.jupyter.lite = true