Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve README #56

Merged
merged 1 commit into from
Sep 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 34 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ This provides an OCaml REPL with a great user interface such as markdown/HTML do

![Screenshot](https://akabe.github.io/ocaml-jupyter/images/screenshot.png)

A [Docker image][ocaml-jupyter-datascience] are distributed on DockerHub. It contains OCaml Jupyter and many packages for data science.

[ocaml-jupyter-datascience]: https://github.com/akabe/docker-ocaml-jupyter-datascience

## Getting started

OCaml Jupyter can be installed by [OPAM][opam] as follows:
Expand All @@ -32,7 +28,16 @@ $ pip install jupyter
$ opam install jupyter
```

which will automatically register the kernel to Jupyter.
which will automatically register the kernel to Jupyter if `jupyter` command is found.
Otherwise (i.e., the command is not found in `$PATH`, or you have not installed Jupyter yet)
you need to manually install the kernel:

```console
$ jupyter kernelspec install --name ocaml-jupyter "$(opam config var share)/ocaml-jupyter"
[InstallKernelSpec] Removing existing kernelspec in /home/USERNAME/.local/share/jupyter/kernels/ocaml-jupyter
[InstallKernelSpec] Installed kernelspec ocaml-jupyter-4.04.2 in /home/USERNAME/.local/share/jupyter/kernels/ocaml-jupyter
```

After installation, you can use `ocaml-jupyter` kernel by launching Jupyter notebook server:

```console
Expand Down Expand Up @@ -104,10 +109,32 @@ See `ocaml-jupyter-kernel --help` for details of command-line parameters in `arg

```console
$ jupyter kernelspec install --name ocaml-jupyter "$(opam config var share)/ocaml-jupyter"
[InstallKernelSpec] Removing existing kernelspec in /home/USERNAME/.local/share/jupyter/kernels/ocaml-jupyter-4.04.2
[InstallKernelSpec] Installed kernelspec ocaml-jupyter-4.04.2 in /home/USERNAME/.local/share/jupyter/kernels/ocaml-jupyter-4.04.2
```

## Docker image

A ready-to-use Docker image [akabe/ocaml-jupyter-datascience][ocaml-jupyter-datascience] are available on DockerHub.
It contains OCaml Jupyter and many packages for data science.

```console
$ docker run -it -p 8888:8888 akabe/ocaml-jupyter-datascience
[I 15:38:04.170 NotebookApp] Writing notebook server cookie secret to /home/opam/.local/share/jupyter/runtime/notebook_cookie_secret
[W 15:38:04.190 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 15:38:04.197 NotebookApp] Serving notebooks from local directory: /notebooks
[I 15:38:04.197 NotebookApp] 0 active kernels
[I 15:38:04.197 NotebookApp] The Jupyter Notebook is running at: http://[all ip addresses on your system]:8888/?token=4df0fee0719115f474c8dd9f9281abed28db140d25f933e9
[I 15:38:04.197 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 15:38:04.198 NotebookApp] No web browser found: could not locate runnable browser.
[C 15:38:04.198 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=4df0fee0719115f474c8dd9f9281abed28db140d25f933e9
```

[ocaml-jupyter-datascience]: https://github.com/akabe/docker-ocaml-jupyter-datascience


## Related work

Many Jupyter kernels for functional programming languages are available such as [IHaskell][ihaskell], [Jupyter Scala][jupyter-scala], and [Jupyter Rust][jupyter-rs]. [IOCaml][iocaml] is another practical OCaml kernel that inspires us, but it seems no longer maintained. OCaml Jupyter kernel differs from IOCaml in
Expand Down