Add interactive "Run" buttons to SMT-LIBv2 code blocks#25
Draft
netolcc06 wants to merge 7 commits into
Draft
Conversation
There was a problem hiding this comment.
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.jsto 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.htmlto 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 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(); |
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.
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.