Skip to content

imjoy-team/jupyter.imjoy.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 

Repository files navigation

ImJoy JupyterLite

Available at https://jupyter.imjoy.io

Development

Create jupyterlite

conda create -n jupyterlite python=3.11
conda activate jupyterlite
pip install "jupyterlite-core[all]"
pip install jupyterlite-pyodide-kernel
jupyter lite init --output-dir=./docs
jupyter lite build --output-dir=./docs
jupyter lite serve --output-dir=./docs --port=8382

Download elFinder

wget https://github.com/imjoy-team/elFinder/archive/refs/heads/gh-pages.zip
unzip gh-pages.zip 
rm gh-pages.zip 
rm -rf docs/elFinder
mv elFinder-gh-pages/ docs/elFinder
cp docs/elFinder/service-worker.js docs # make sure we have service worker for all domains
pip install -U imjoy-jupyterlab-extension
jupyter lite build --output-dir=./docs
jupyter lite serve --output-dir=./docs --port=8382

Note: Make sure we restore the CNAME file:

echo "jupyter.imjoy.io" > docs/CNAME
echo "" > docs/.nojekyll

Load content with ImJoy API

const jupyter = await api.createWindow({src: "https://jupyter.imjoy.io/lab/index.html", window_id: "jupyter-container", config: {"left_collapsed": true}})
const content = await (await fetch("https://raw.githubusercontent.com/imjoy-team/imjoy-tutorials/master/2-bioengine/1-bioengine-engine-tutorial.ipynb")).text()
if(await jupyter.fileExists('my-file.ipynb')){
    await jupyter.removeFile('my-file.ipynb')
}
const filePath = await jupyter.loadFile('my-file.ipynb', content, 'application/json')
await jupyter.openFile(filePath)

Releases

No releases published

Packages

No packages published