liuderchi / learn-js-in-jupyter

πŸ“™ Interactive, cross-platform JavaScript ES6 / Python 3,2 notebook powered by JupyterLab and Docker

Home Page:https://hub.docker.com/r/liuderchi/learn-js-in-jupyter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Learn JS in Jupyter

πŸ“™ Your interactive learning notebook for JavaScript ES6 / Python 3 / Python 2
Powered by Awesome JupyterLab and docker 🐳 . Fun to use; Easy to install πŸ‘©β€πŸ’» πŸ‘¨β€πŸ’».



demo-1

Run Online with Play With Docker in 5 min (free)

  1. Click Try in PWD to launch a new container.
    After the stack builder is finished, close the dialog.
  • pwd-run-1
  1. Get Access Token by running this command in the terminal prompt:
docker exec $(docker container list | awk 'FNR==2{print $1}') sh -c 'jupyter notebook list' \
  | awk 'FNR==2{print $1}' | grep -E 'token=(.*)' -o | cut -c7-54
  1. Click the link above to access Jupyter page:
  • pwd-run-2
  1. In page paste the token in the input field to login
  • pwd-run-3
  1. πŸŽ‰ Congrats! Now you can create a Notebook with JavaScript, Python 3 or Python 2 Environment!
    Type some code and press shift + enter to run it!
  • pwd-run-4
  • pwd-run-5

Running Locally with Docker

  1. Run Following command in your terminal:
docker run -d -p 8888:8888 liuderchi/learn-js-in-jupyter:latest
  1. Run following command to get Jupyter token. Then Copy it.
docker exec $(docker container list | awk 'FNR==2{print $1}') sh -c 'jupyter notebook list' \
    | awk 'FNR==2{print $1}' | grep -E 'token=(.*)' -o | cut -c7-54
  1. In browser go to localhost:8888?token=PASTE_JUPYTER_TOKEN_HERE

Alternatively, use this One Liner for step 2 and step 3:

python -mwebbrowser $(docker exec $(docker container list | awk 'FNR==2{print $1}') sh -c 'jupyter notebook list' | awk 'FNR==2{print $1}')

Running and Saving Changes Locally

$ git clone https://github.com/liuderchi/learn-js-in-jupyter.git
$ cd learn-js-in-jupyter
$ docker run -d -p 8888:8888 \
  -v $PWD/notebooks:/root/learn-js-in-jupyter \
  -v $PWD/jupyterlab-settings:/root/.jupyter/lab/user-settings/@jupyterlab \
  liuderchi/learn-js-in-jupyter:latest

# open in browser with token in url
$ python -mwebbrowser $(docker exec $(docker container list | awk 'FNR==2{print $1}') \
  sh -c 'jupyter notebook list' | awk 'FNR==2{print $1}')

License

MIT License

About

πŸ“™ Interactive, cross-platform JavaScript ES6 / Python 3,2 notebook powered by JupyterLab and Docker

https://hub.docker.com/r/liuderchi/learn-js-in-jupyter/

License:MIT License


Languages

Language:Jupyter Notebook 63.3%Language:JavaScript 25.9%Language:Dockerfile 6.8%Language:Shell 4.0%