Skip to content

Commit

Permalink
Fix loading
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Aug 15, 2024
1 parent 639e1fa commit 1267d33
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ JupyterLite deployed as a static site to GitHub Pages, for demo purposes.

## Try it in your browser

➡️ https://quansight.github.io/jupyterlite-demo/
➡️ https://quansight.github.io/jupyterlite-demo/files/demo.html
- https://quansight.github.io/jupyterlite-demo/
- https://quansight.github.io/jupyterlite-demo/files/demo.html

## Requirements

Expand Down
10 changes: 8 additions & 2 deletions content/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
.content {
padding: 4px
}
code[data-run] {
white-space: pre-wrap;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -98,11 +101,14 @@
}
cleanCode += line.substring(indent) + '\n';
}
codeEl.textContent = cleanCode;
iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1&code=${cleanCode}`;
iframe.document.head.appendChild(styleSheet);
iframe.style.width = '100%';
iframe.style.height = '300px';
codeEl.replaceWith(iframe);
iframe.onload = () => {
iframe.contentDocument.head.appendChild(styleSheet);
codeEl.replaceWith(iframe);
}
}
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
Expand Down

0 comments on commit 1267d33

Please sign in to comment.