Skip to content

Instantly share code, notes, and snippets.

@Mbrownshoes
Created June 11, 2019 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mbrownshoes/1267ca609da3e6e088f4e7a604f9ee0c to your computer and use it in GitHub Desktop.
Save Mbrownshoes/1267ca609da3e6e088f4e7a604f9ee0c to your computer and use it in GitHub Desktop.
embed test
<!DOCTYPE html>
<style>
</style>
<div class="notebook-content">
</div>
<script type="module">
import notebook from "https://api.observablehq.com/@bumbeishvili/jsfiddle-embed-notebook.js"; // "download code" url
document.querySelector('.notebook-content').innerHTML =notebook.modules[0].variables
.filter(d=>d)
.map((d,i)=>` <div class=" observable-wrapper div-number-${i}"></div>`)
.join('');
import {Inspector, Runtime} from "https://unpkg.com/@observablehq/runtime@3/dist/runtime.js";
let i=1;
Runtime.load(notebook, (variable) => {
return new Inspector(document.querySelector(`.observable-wrapper:nth-child(${i++})`));
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment