Skip to content

Add interactive "Run" buttons to SMT-LIBv2 code blocks#25

Draft
netolcc06 wants to merge 7 commits into
cvc5:mainfrom
netolcc06:run-wasm
Draft

Add interactive "Run" buttons to SMT-LIBv2 code blocks#25
netolcc06 wants to merge 7 commits into
cvc5:mainfrom
netolcc06:run-wasm

Conversation

@netolcc06

Copy link
Copy Markdown
Contributor

Adds a lightweight client-side script (smt-runner.js) that injects a "Run" button below every SMT-LIBv2 input block in the tutorial pages.

Clicking the button opens the CVC5 WASM solver (appjs/index.html) in a new tab with the code pre-loaded via the URL hash, which automatically fills the editor and runs the solver.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an interactive “Run” experience to the Beginner tutorial’s SMT-LIBv2 code blocks by injecting a client-side “Run” button and wiring the solver page to accept SMT input via the URL hash.

Changes:

  • Add smt-runner.js to inject “Run” buttons under SMT-LIBv2 input blocks and open the WASM solver with the SMT preloaded via #smt=....
  • Modify the Beginner tutorial theme JS to load smt-runner.js.
  • Update appjs/index.html to parse #smt=..., preload the editor, and auto-run once the module is loaded.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tutorials/beginners/static/smt-runner.js Injects “Run” buttons into SMT-LIBv2 code blocks and opens the solver with the encoded SMT script.
tutorials/beginners/static/js/theme.js Loads smt-runner.js from the tutorial theme bundle.
appjs/index.html Adds hash parsing and auto-run logic for #smt=... links.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +89 to +92
var t = n(this);
expand = n('<button class="toctree-expand" title="Open/close menu"></button>'), expand.on("click", (function(n) {
return e.toggleCurrent(t), n.stopPropagation(), !1
})), t.prepend(expand)
Comment on lines +1 to +5
! function(n) {
var e = {};

function t(i) {
if (e[i]) return e[i].exports;
Comment thread appjs/index.html
Comment on lines +610 to +618
// Wait for the WASM module, then run
function tryRun() {
if (typeof moduleLoaded === 'undefined' || !moduleLoaded) {
setTimeout(tryRun, 50);
return;
}
runSolver();
}
tryRun();
@netolcc06 netolcc06 marked this pull request as draft June 16, 2026 17:14
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