From f7edb3d8281b5e2376dc5d237dced3dfa2a0f12e Mon Sep 17 00:00:00 2001 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: Fri, 16 Aug 2024 10:01:25 +0100 Subject: [PATCH] Try using a command, service worker cache and favicon --- content/demo-dev.html | 10 +++++++--- jupyter-lite.json | 3 ++- repl/jupyter-lite.json | 6 ++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/content/demo-dev.html b/content/demo-dev.html index cd6927f..58eca09 100644 --- a/content/demo-dev.html +++ b/content/demo-dev.html @@ -61,7 +61,7 @@

You need to change solver, by passing an argument like this solver="saga", see below:

- + from sklearn import datasets from sklearn.linear_model import LogisticRegression @@ -81,6 +81,9 @@ .jp-CodeConsole-banner { display: none; } + .jp-PoweredBy { + display: none !important; + } `; const loader = document.getElementById('loader'); @@ -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); } diff --git a/jupyter-lite.json b/jupyter-lite.json index f4f9518..6437c2b 100644 --- a/jupyter-lite.json +++ b/jupyter-lite.json @@ -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" } } diff --git a/repl/jupyter-lite.json b/repl/jupyter-lite.json index 98b6897..5673782 100644 --- a/repl/jupyter-lite.json +++ b/repl/jupyter-lite.json @@ -9,6 +9,8 @@ "@jupyterlite/application-extension:logo", "jupyterlab-nebari-mode:logo", "@jupyter-notebook/lab-extension:interface-switcher" - ] + ], + "exposeAppInBrowser": true, + "enableServiceWorkerCache": true } -} \ No newline at end of file +}