set_nb_cells#
import compwa_policy.set_nb_cells
Add or update standard cells in a Jupyter notebook.
Notebook servers like Google Colaboratory and Deepnote do not install a package automatically, so this has to be done through a code cell. At the same time, this cell needs to be hidden from the documentation pages, when viewing through Jupyter Lab (Binder), and when viewing as Jupyter slides.
This scripts sets the IPython InlineBackend.figure_formats option to SVG. This is because the Sphinx configuration can’t set this externally.
Notebooks can be ignored by making the first cell a Markdown cell and writing the following Markdown comment:
<!-- no-set-nb-cells -->