You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[](https://github.com/davy39/xeus-ocaml/actions/workflows/ci.yml)
4
5
[](https://github.com/davy39/xeus-ocaml/actions/workflows/release.yml)
`xeus-ocaml` is a Jupyter kernel for the OCaml programming language that runs entirely in the web browser through WebAssembly. It is built on the `xeus-lite` library, a lightweight C++ implementation of the Jupyter protocol for WASM environments.
8
9
@@ -19,7 +20,49 @@ Experience `xeus-ocaml` firsthand in your browser by visiting the JupyterLite de
19
20
***Fully Browser-Based**: Runs entirely in the browser with no server-side installation, powered by WebAssembly.
20
21
***Interactive OCaml Toplevel**: Execute OCaml code interactively, with persistent state between cells.
21
22
***Rich Language Intelligence**: Provides code completion and inspection (tooltips on hover/Shift+Tab) through an integrated Merlin engine.
22
-
***JupyterLite Integration**: Designed for seamless use within the JupyterLite environment.
23
+
***Rich Display Support**: Render HTML, Markdown, SVG, JSON, and even complex plots like Vega-Lite directly from your OCaml code.
24
+
25
+
## 📊 Rich Display and Visualization
26
+
27
+
The kernel comes with a built-in `Xlib` library that is **automatically opened** on startup, so its functions are immediately available in the global scope. This library provides a simple API for rendering a wide variety of rich outputs in your notebook cells.
@@ -64,17 +107,29 @@ This project uses the `pixi` package and environment manager to streamline devel
64
107
```bash
65
108
pixi run -e ocaml build
66
109
```
110
+
4. **Build the Kernel**
111
+
This build the kernel and create a conda package.
112
+
```bash
113
+
pixi run build-kernel
114
+
```
115
+
5. **Install the kernel**
116
+
This install the kernel to be used with Jupyterlite.
117
+
```bash
118
+
pixi run install-kernel
119
+
```
120
+
6. **Serve Jupyterlite**
121
+
This build and serve the Jupyterlite interface.
122
+
```bash
123
+
pixi run install-kernel
124
+
```
125
+
You can now access the local JupyterLite instance in your browser, typically at `http://localhost:8000`.
67
126
68
-
4. **Build the WASM Kernel and Serve JupyterLite**
69
-
This is a convenience command that performs all remaining steps:
70
-
* Builds the C++ kernel to WASM using `rattler-build`.
71
-
* Packages the kernel and `xocaml.js` into a conda package.
72
-
* Installs the package into a local environment.
73
-
* Builds and launches a local JupyterLite server.
127
+
7. **All in one command**
128
+
This is a convenience command that performs all steps:
74
129
```bash
75
130
pixi run build-all-serve
76
131
```
77
-
You can now access the local JupyterLite instance in your browser, typically at `http://localhost:8000`.
132
+
78
133
79
134
## 🧪 Testing
80
135
@@ -91,6 +146,7 @@ pixi run -e test test
91
146
- [x] Interactive code execution via the `js_of_ocaml` toplevel.
92
147
- [x] Code completion powered by an in-browser Merlin instance.
93
148
- [x] Code inspection for tooltips (Shift+Tab) and the inspector panel.
149
+
- [x] **Rich Outputs**: Display HTML, Markdown, SVG, JSON, and Vega-Lite plots directly from OCaml code using the auto-opened `Xlib` module.
94
150
95
151
### Future Work
96
152
- [ ] **Library Management**: Implement a mechanism to dynamically fetch and load pre-compiled OCaml libraries from within a notebook session (e.g., via `#require`).
0 commit comments