Jupyter's kernel for Elixir
Implementation is inspired by IElixir
, while all the codebase is totally rewritten to fit escripts
, Elixir's 1.12 Mix.install/2
feature and kernel management introduced by livebook
.
All the code for node management is fully taken from livebook
's codebase.
This project is distributed under the MIT
license, while node management parts are distributed under Apache License 2.0
, inherited from livebook
.
You must have:
- One of the
jupyter
's installations - Elixir 1.12 or higher
To use this kernel, you need to have a Jupyter
installed. You can find instructions on how to install it here.
The simplest way to do this is to run:
$ pip install jupyter
Installing it with a virtual environment is recommended, but instructions to do it are out of this document's scope.
This frontend is a modern approach to work with Jupyter's kernels, supports more features, and is recommended for been used for most cases. You can find instructions on how to install it here.
The simplest way to do this is to run:
$ pip install jupyterlab
This command will also install the original jupyter notebook
under the hood.
You need to have Elixir installed. You can find instructions on how to install it here. For sure you know how to do it if you are trying to use this project.
Installation is pretty simple:
-
Install the escript for this kernel:
$ mix escript.install github spawnfest/ielixir
-
Make the
jupyter
to know our new kernel:$ ielixir install
-
(Optional) If you want to use the
jupyterlab
frontend, you need to additionalielixir
lablexicon:$ jupyter labextension install jupyterlab-ielixir
And you are all set!
-
Build the docker image using presented
Dockerfile
:docker build . -t ielixir
-
Run the image to get your server running on
8000
port:docker run -p 8000:8000 ielixir
-
In docker's output you will see a link with defined token. Use it to open your
Jupyter Lab
in the browser.
NOTE! Default workspace is empty! If you need to work with a workspace that exists on your host machine -
you need to mount this folder inside containers /workspace
folder.
docker run --mount type=bind,source=path/to/workspace/,target=/workspace -p 8000:8000 ielixir
For example, to run examples from project's root use:
docker run --mount type=bind,source="$(pwd)"/resources/examples,target=/workspace -p 8000:8000 ielixir
-
jupyter
messaging protocol -
Elixir
node for each kernel- Standalone
-
mix project
-
remote
- Code highlighting for
- input
- output
- History saving and exposing
- Compatibility with
-
console
-
notebook
-
lab
-
vscode
extension
-
- Providing protocol for output decoration
- Client side
- kernel side
- Automaticly decorating
- pictures
- vega plots
- jsons
- Autocompletion
- Intellisense
- Perfect cursor positioning
- Example notebooks
- Intro to Jupyter
- Intro to Elixir inside IElixir
- Intro to Elixir
- Example from Elixir's official syte