Skip to content

Commit

Permalink
Try using a command, service worker cache and favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Aug 16, 2024
1 parent 25f332f commit f7edb3d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 7 additions & 3 deletions content/demo-dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<div class="user"><i class="bi bi-person-fill"></i></div>
<div class="content">
<p>You need to change solver, by passing an argument like this <code>solver="saga"</code>, see below:</p>
<code data-not-run>
<code data-run>
from sklearn import datasets
from sklearn.linear_model import LogisticRegression

Expand All @@ -81,6 +81,9 @@
.jp-CodeConsole-banner {
display: none;
}
.jp-PoweredBy {
display: none !important;
}
`;
const loader = document.getElementById('loader');

Expand Down Expand Up @@ -109,12 +112,13 @@
cleanCode += line.substring(indent) + '\n';
}
codeEl.textContent = cleanCode;
iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1&code=${encodeURIComponent(cleanCode)}`;
iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1`;
iframe.style.width = '100%';
iframe.style.height = '300px';
iframe.style.height = '400px';
iframe.onload = () => {
if (iframe.contentDocument) {
iframe.contentDocument.head.appendChild(styleSheet);
iframe.contentDocument.jupyterlab.commands.execute('console:replace-selection', {text: cleanCode})
}
codeEl.replaceWith(iframe);
}
Expand Down
3 changes: 2 additions & 1 deletion jupyter-lite.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"jupyter-config-data": {
"disabledExtensions": [
"@jupyterlite/application-extension:logo"
]
],
"faviconUrl": "https://raw.githubusercontent.com/nebari-dev/nebari-design/main/symbol/favicon.ico"
}
}
6 changes: 4 additions & 2 deletions repl/jupyter-lite.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"@jupyterlite/application-extension:logo",
"jupyterlab-nebari-mode:logo",
"@jupyter-notebook/lab-extension:interface-switcher"
]
],
"exposeAppInBrowser": true,
"enableServiceWorkerCache": true
}
}
}

0 comments on commit f7edb3d

Please sign in to comment.