Execute All Notebooks
Execute all registered notebooks, strip noisy metadata, and sync Jupytext pairs.
Steps
- Read
_quarto.ymland extract all notebook paths frommanuscript.notebooks - For each notebook, execute it:
```bash
uv run jupyter execute --inplace notebooks/<name>.ipynb
```
Record execution time and success/failure for each notebook.
- After all notebooks execute, strip noisy cell metadata from every
.ipynbfile.
Open each .ipynb as JSON and remove these keys from every cell's metadata object:
execution(timestamps added byjupyter execute)_sphinx_cell_id(MyST/Sphinx artifact)vscode(VS Code editor state)
Save the cleaned JSON back to the file (preserve formatting with 1-space indent).
- Sync all Jupytext
.mdpairs:
```bash
uv run jupytext --sync notebooks/<name>.md
```
- Report a summary table:
- Notebook name
- Status (success / failure)
- Execution time
- Any errors or warnings
Error handling
- If a notebook fails to execute, continue with the remaining notebooks. Report the error at the end.
- If
_quarto.ymlhas no notebooks registered, report "No notebooks found in _quarto.yml" and stop.