Skip to content

Commit

Permalink
Updated path to jupyter notebooks (#122)
Browse files Browse the repository at this point in the history
To avoid problems with the service worker due to caching between
versions, I updated the path to jupyter notebooks. I seem to remember
that the potential cache comes from the URL to the service worker's JS
file with now is updated.
  • Loading branch information
andeplane authored Oct 5, 2024
2 parents 4060c74 + 85c045e commit 0cc3749
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
python -m pip install -r jupyterlite/requirements.txt
- name: Build JupyterLite site
run: |
jupyter lite build --contents jupyterlite/content --output-dir public/jupyter
jupyter lite build --contents jupyterlite/content --output-dir public/jupyterlite
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pip install -r jupyterlite/requirements.txt
Build JupyterLite

```
jupyter lite build --contents jupyterlite/content --output-dir public/jupyter
jupyter lite build --contents jupyterlite/content --output-dir public/jupyterlite
```

### Run locally
Expand Down
10 changes: 5 additions & 5 deletions src/containers/Notebook.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Iframe from "react-iframe";
import { useStoreState } from "../hooks";
const Notebook = () => {
const simulation = useStoreState((state) => state.simulation.simulation);

let notebookUrl = `/atomify/jupyter/lab/index.html?path=analyze.ipynb`;
const simulation = useStoreState(state => state.simulation.simulation)
let notebookUrl = `/atomify/jupyterlite/lab/index.html?path=analyze.ipynb`
if (simulation?.analysisScript) {
const analysisScriptPath = `${simulation.id}/${simulation.analysisScript}`;
notebookUrl = `/atomify/jupyter/lab/index.html?path=${analysisScriptPath}`;
const analysisScriptPath = `${simulation.id}/${simulation.analysisScript}`
notebookUrl = `/atomify/jupyterlite/lab/index.html?path=${analysisScriptPath}`
}

return (
Expand Down

0 comments on commit 0cc3749

Please sign in to comment.