Skip to content

Commit

Permalink
improve getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSkovMadsen committed Jan 14, 2024
1 parent bf0d6e0 commit cd89c4e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jupyter_execute
# this dir contains the whole website and should not be checked in on main
builtdocs/
.doit.db

lite/files/*/
.jupyterlite.doit.db

# jetbrains settings
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
hooks:
- id: clean-notebook
args: [-i, tags]
exclude: '^lite/files'
exclude: '^lite/files/.*/'
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
5 changes: 0 additions & 5 deletions lite/files/Getting_Started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (Pyodide)",
"language": "python",
"name": "python"
},
"language_info": {
"name": "python",
"pygments_lexer": "ipython3"
Expand Down
64 changes: 3 additions & 61 deletions lite/files/Reset_Jupyterlite.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,7 @@
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
"<button type=\"button\" id=\"button_for_indexeddb\">Clear JupyterLite local storage</button>\n",
"<div id=\"clear-storage-message\"></div>\n",
"<script>\n",
"window.button_for_indexeddb.onclick = function(e) {\n",
" message = document.getElementById(\"clear-storage-message\")\n",
" message.innerText=\"Running\"\n",
" window.indexedDB.open('JupyterLite Storage').onsuccess = function(e) {\n",
" // There are also other tables that I'm not clearing:\n",
" // \"counters\", \"settings\", \"local-storage-detect-blob-support\"\n",
" let tables = [\"checkpoints\", \"files\"];\n",
"\n",
" let db = e.target.result;\n",
" let t = db.transaction(tables, \"readwrite\");\n",
"\n",
" function clearTable(tablename) {\n",
" let st = t.objectStore(tablename);\n",
" st.count().onsuccess = function(e) {\n",
" console.log(\"Deleting \" + e.target.result + \" entries from \" + tablename + \"...\");\n",
" st.clear().onsuccess = function(e) {\n",
" console.log(tablename + \" is cleared!\");\n",
" }\n",
" }\n",
" }\n",
"\n",
" for (let tablename of tables) {\n",
" clearTable(tablename);\n",
" }\n",
" }\n",
" message.innerText=\"JupyterLite local storage has successfully been reset\"\n",
"};\n",
"</script>\n"
],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"from IPython.display import display, HTML\n",
"display(HTML(\"\"\"\n",
Expand Down Expand Up @@ -95,24 +51,10 @@
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
},
"orig_nbformat": 4
"pygments_lexer": "ipython3"
}
},
"nbformat": 4,
"nbformat_minor": 2
Expand Down

0 comments on commit cd89c4e

Please sign in to comment.