graphical output in code blocks

This commit is contained in:
りき萌 2024-02-18 00:29:58 +01:00
parent 565b6a0520
commit 51de33c2b5
13 changed files with 351 additions and 57 deletions

32
template/sandbox.hbs Normal file
View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>treehouse iframe sandbox</title>
<style>
body {
margin: 0;
overflow: hidden;
}
</style>
<script type="importmap">{ "imports": { "treehouse/": "{{ config.site }}/static/js/" } }</script>
<script type="module">
import { evaluate } from "treehouse/components/literate-programming/eval.js";
console.log("yo");
addEventListener("message", async event => {
let message = event.data;
if (message.action == "eval") {
document.body.replaceChildren();
evaluate(message.input);
}
});
</script>
</head>
<body></body>
</html>