-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
enhancementNew feature or requestNew feature or requestneeds more investigationThis issue or pull request needs more investigationThis issue or pull request needs more investigation
Description
Currently, we generate notebooks for the TryExamples directive, and the JupyterLite, NotebookLite, and Voici directives can take a path to a notebook.
While we can disable the JupyterLite source maps to reduce build size (a technique used downstream in scikit-learn/scikit-learn#26246, numpy/numpy#26745, and sympy/sympy#27419), I've opened this issue as an open-ended item to see if jupyterlite-sphinx as a companion to JupyterLite can reduce its footprint by reducing the size of the notebooks that are eventually copied into the JupyterLite folder.
- Use https://github.com/arve0/ipynbcompress? It has not been maintained for the last two years; maybe we can fork it or take over maintenance via PEP 541?
- Use
optipng(if available) or projects with Python bindings to it, orpillowas an optional dependencies to reduce the size of images in the docs: https://sphinx-gallery.github.io/stable/gen_modules/sphinx_gallery.utils.optipng.html - Use
nbstripoutif enabled via a global config option to clear all outputs (except thejupyterlite_sphinx_striptag) and kernel metadata from all notebooks (maybe not for theTryExamplesnotebooks, but this would be useful for long-form notebooks – thescikit-learndocs via Sphinx-Gallery already to seem to do this: https://sphinx-gallery.github.io/stable/auto_examples/plot_9_multi_image_separate.html.- We don't currently do this for Markdown notebooks that were added in Support the usage of Markdown-based notebooks with "Lite" directives #221. Since they don't contain the outputs of the cells in their contents, they don't have any outputs upon conversion to IPyNB either.
- However, conventional IPyNB files can indeed contain outputs, which we can explore stripping.
Reductions in sizes will be helpful for:
- projects deploying documentation via GitHub Pages or on other static webpage hosts
- reducing bandwidth usage for readers of said documentation
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestneeds more investigationThis issue or pull request needs more investigationThis issue or pull request needs more investigation