Skip to content

Add HTML export and cell execution checking to nbexec - #192

Merged
janpfeifer merged 20 commits into
mainfrom
nbexec-export-html
Jun 7, 2026
Merged

Add HTML export and cell execution checking to nbexec#192
janpfeifer merged 20 commits into
mainfrom
nbexec-export-html

Conversation

@janpfeifer

@janpfeifer janpfeifer commented Jun 7, 2026

Copy link
Copy Markdown
Owner

This pull request adds two new features to the nbexec tool:

  1. -export_html flag: Exports the notebook as HTML to a specified destination path after execution. Headless Chrome is configured to download the HTML to a temporary directory first, avoiding path pollution, and then moves the file to its final target path (with fallback copy-handling across different filesystems).
  2. -check_cells flag: Parses the executed .ipynb file after completion and checks for any compilation errors (via output_type: "error") or runtime errors/panics (via checking stderr for exit status or panic:). Prints a detailed error report of failed cells and exits the nbexec process with exit code 1 if any failures occurred.
  3. Added hover context for execution errors (similar to what was already there for compilation errors); Hover context also activated over the cell number.
  4. Fixed layout issues on error HTML output.

Additionally, this PR adds a new test notebook at examples/tests/errors.ipynb and implements the corresponding integration test TestErrors in internal/nbtests/nbtests_test.go to verify these error-matching behaviors and line numbers.

janpfeifer added 20 commits June 7, 2026 08:59
…overing over the cell/line area, in addition to the file/line area.

* Added support for rich HTML execution/runtime error reporting, enabling hoverable popups that show code context directly over Go stack traces printed to stderr (e.g. panics and fatal logs).
… Jupyter (not buffered), and the rich hover-popup HTML boxes for cell-related error lines are printed after the execution exits.

* Improved error CSS layout to wrap long code lines without displaying horizontal scrollbars.
Added cloned GoNB to `go.work` by default.
@janpfeifer
janpfeifer merged commit 734ddcd into main Jun 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant