In this examples folder, we only keep the light-weight .py files that will appear in the docs.
The tutorials folder will be built with sphinx-gallery (all examples starting with plot_) will be run in
Read The Docs and added to the documentation at run-time.
The how_to examples, instead, are manually run and added to the documentation.
To do so, we use jupytext to sync the .py files with an associated notebook, and then convert the notebook to .rst
with nbconvert. Here are the steps (in this example for the get_started):
- Create a notebook from the .py file:
>>> jupytext --to notebook get_started.py
>>> jupytext --set-formats ipynb,py get_started.ipynb
-
Run the notebook
-
Sync the run notebook to the .py file:
>>> jupytext --sync get_started.ipynb
- Convert the notebook to .rst
>>> jupyter nbconvert get_started.ipynb --to rst
- Move the .rst and associated folder (e.g.
get_started.rstandget_started_filesfolder) to thedoc/how_to.