Skip to content

Commit

Permalink
Code lines
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Aug 15, 2024
1 parent d6202ad commit 0f2bef0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@
break;
}
let cleanCode = '';
let codeLines = '';
for (const line of code.split('\n')) {
if (cleanCode === '' && line.length === 0) {
continue
}
cleanCode += line.substring(indent) + '\n';
codeLines += '&code=' + line.substring(indent);
}
codeEl.textContent = cleanCode;
iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1&code=${cleanCode}`;
iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1&${codeLines}`;
iframe.style.width = '100%';
iframe.style.height = '300px';
iframe.onload = () => {
Expand Down

0 comments on commit 0f2bef0

Please sign in to comment.