-
-
Save RobinL/4d085b61ab936b09a0cba9865b3203fc to your computer and use it in GitHub Desktop.
This file contains 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
<head> | |
<script type="module"> | |
// Load the Observable runtime and inspector. | |
import { Runtime, Inspector } from "https://unpkg.com/@observablehq/notebook-runtime?module"; | |
// Your notebook, compiled as an ES module. | |
import notebook from "https://api.observablehq.com/@robinl/my-test-site.js?key=a660656b583fb4c7"; | |
let outputs = ["title", "viewof selectbox", "commentary", "chart", "table"] | |
var cells = document.getElementById("cells") | |
let outputs_divs = outputs.map(function(d) { | |
let new_cell = document.createElement("div") | |
new_cell.id = d | |
new_cell.className = "cell" | |
cells.appendChild(new_cell) | |
return new_cell | |
}) | |
Runtime.load(notebook, (cell) => { | |
if (outputs.includes(cell.name)) { | |
var this_cell = document.getElementById(cell.name) | |
return { | |
fulfilled: (value) => { | |
this_cell.innerHTML = ''; | |
this_cell.appendChild(value) | |
} | |
}; | |
} | |
}); | |
</script> | |
</head> | |
<body> | |
<div id="cells"></div> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment