-
Notifications
You must be signed in to change notification settings - Fork 208
Description
I have a workflow with jupyter-book where I strip notebook outputs and some metadata such as kernelspec. When kernelspec is missing from the notebooks then the built pages are missing the launcher button. Seems to be because of the check at
| def _is_notebook(app, pagename): |
I want to remove the kernelspec so that notebooks edited using different conda kernels will default back to a "default" blank kernel when in version control, which I found to be necessary when jupyter-book is running in CI and does not necessarily have access to a kernel of the same name as that stored in the kernelspec (jupyter-book tries to use such a kernel, and as far as I can tell doesn't have an override to force a particular kernel for all notebooks?). Removing that kernelspec is also nice to keep the git history cleaner.
I'm using the nbstripout pre-commit hook (like this) to do this, but it doesn't seem possible to use it to simply rewrite that metadata rather than removing it. I'm also looking at using the jupytext pre-commit hook to do that.
Is this check for the kernelspec presence necessary?