Skip to content

DRAFT: numbl interactive examples in docs#6

Open
magland wants to merge 3 commits into
danfortunato:masterfrom
magland:numbl-interactive-examples
Open

DRAFT: numbl interactive examples in docs#6
magland wants to merge 3 commits into
danfortunato:masterfrom
magland:numbl-interactive-examples

Conversation

@magland

@magland magland commented Jun 3, 2026

Copy link
Copy Markdown

magland added 2 commits June 3, 2026 08:17
Turn the MATLAB example snippets throughout the documentation into
editable, in-browser-runnable widgets powered by numbl (https://numbl.org).
Each example keeps its existing static figure/output and gains an
"Edit & run" button that opens a self-contained, editable copy of the
script; nothing loads until the reader clicks.

- conf.py: load the numbl-embed loader via html_js_files
- _static/js/numbl-embed.js: the <numbl-embed> custom element (lazy mode)
- _static/css/custom.css: embed styling
- surfacefun / surfacemesh / surfaceop and the worked examples: each
  runnable snippet inlined as a self-contained script
@danfortunato

Copy link
Copy Markdown
Owner

Wow pretty cool!

@danfortunato

Copy link
Copy Markdown
Owner

I wonder if we could get the RNG to output the same as MATLAB so that the generated data looks the same.

Also, for the Hodge decomposition example, the error seems to be much larger in Numbl than MATLAB.

@magland

magland commented Jun 3, 2026

Copy link
Copy Markdown
Author

I wonder if we could get the RNG to output the same as MATLAB so that the generated data looks the same.

That would be really hard.

Also, for the Hodge decomposition example, the error seems to be much larger in Numbl than MATLAB.

Let's look at this together so I can know how to troubleshoot.

The mip load line now runs as a numbl-preamble block (shown as "Installing surfacefun...") instead of cluttering the editable example. Renames the script class to numbl-script and syncs the numbl-embed.js loader to the preamble-aware version.
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.

2 participants