replace notebooks with jupytext#5195
Open
danshapero wants to merge 4 commits into
Open
Conversation
Store the introductory Jupyter notebooks as jupytext py:percent scripts instead of committing large executed .ipynb files, and render them into the Sphinx website. - Convert the 12 notebooks under docs/notebooks to py:percent .py files (source of truth) and remove the .ipynb. Add docs/notebooks/jupytext.toml pinning the format and preserving cell `tags`. - Drive notebook behaviour with standard Jupyter cell tags rather than nbval comment markers: `raises-exception` (honoured by both nbval and nbconvert/nbsphinx), plus `skip-execution`/`nbval-skip` for Colab-only install cells and `nbval-ignore-output`. No build-time tagging script. - Build: convert .py -> .ipynb, execute once, and render with nbsphinx (executed in the docs/Makefile, nbsphinx_execute='never'). Each page gets a "Run on Colab" badge. Rewrite notebooks.rst as a toctree index. - Add nbsphinx/jupytext/ipykernel/ipympl to the docs extra, jupytext to the ci/docker extras, and install pandoc in the docs CI job. - Update the notebook test to convert .py -> .ipynb before running nbval, and the colab publishing job to convert before copying. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Notebooks with several level-1 (``#``) headings produced a table of contents that listed each heading (e.g. "Exercises", "Part II") as an undistinguished top-level entry alongside the notebook title, because Sphinx cannot pick a page title when a document has multiple top-level sections. Demote the extra top-level sections (and their subsections) in 01-spd-helmholtz, 02-poisson, 03-elasticity, 07-geometric-multigrid and 12-HPC_demo so each notebook has exactly one ``#`` title with the rest nested beneath it. The TOC now shows one entry per notebook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Putting `monospace text` inside a link text is broken.
Contributor
Author
|
The doc build is failing because of a link from the FEnICS 2015 conference to the Transport for London website. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4735 . I pointed Claude at this and it got most of the way there. It saves about 6MB of rendered notebooks. I looked over the generated HTML docs and made a few minor fixes: adding top-level headings to the notebooks; removing some unnecessary preamble code; and fixing some goofed up link formatting.
There are still some warnings in the rendered sum-factorization notebook but those are because of FInAT.