graphical output in code blocks
This commit is contained in:
parent
565b6a0520
commit
51de33c2b5
13 changed files with 351 additions and 57 deletions
32
template/sandbox.hbs
Normal file
32
template/sandbox.hbs
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue