Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abingham/jupyter-elm-kernel
A Jupyter kernel for running Elm code.
https://github.com/abingham/jupyter-elm-kernel
elm jupyter-kernels
Last synced: 4 days ago
JSON representation
A Jupyter kernel for running Elm code.
- Host: GitHub
- URL: https://github.com/abingham/jupyter-elm-kernel
- Owner: abingham
- License: mit
- Created: 2017-03-27T14:06:00.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-02-09T00:00:56.000Z (almost 5 years ago)
- Last Synced: 2024-12-02T03:54:56.957Z (about 1 month ago)
- Topics: elm, jupyter-kernels
- Language: Python
- Homepage:
- Size: 198 KB
- Stars: 64
- Watchers: 7
- Forks: 12
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This kernel adds support for Elm to [Jupyter](http://jupyter.org/) notebooks.
While basic functionality is in place, this is still very much a work in
progress. I'm still figuring it all out. Any help, ideas, etc. would be great.# Requirements
- Python 3.6+# Installation
Either install from a repository using `pip`:
```
pip install elm_kernel
```or install the package from source:
```
pip install -e .
```Then install the kernel spec:
```
python -m elm_kernel.install
```# Usage
Run `jupyter notebook` and select the Elm kernel for a new notebook.
## Multi-cell code examples
By default, when you execute a code cell with the Elm kernel the code will *not*
be compiled. Instead, the kernel simply queues up code cells. This way you can
break longer examples over multiple cells, interleaving the code cells with
supporting Markdown cells.In order to ask the kernel to actually compile your code, you need to terminate
a code cell with the line:```
-- compile-code
```When the kernel sees a cell like this it contatenates, in cell-execution order,
all of the executed but uncompiled code cells (i.e. everything since the start
of the kernel or the last `-- compile-code` cell). It then compiles the
concatenated code, returning the result to the notebook.For a concrete example of this, see
[`examples/the-elm-architecture.ipynb`](https://github.com/abingham/jupyter-elm-kernel/blob/master/examples/the-elm-architecture.ipynb).This is a bit hacky, and we're actively searching for a better alternative.
Ideas are welcome!# Examples
The `examples` directory contains a few examples of how to use this kernel. Just
go to that directory and run `jupyter notebook` to see them.