Dune utop as a browser notebook

Is there a way to get dune utop as a ‘browser notebook’ (like ipython) ?

In particular, I want all the auto completion features of dune utop repl, but I also want it to be able to render HTML.


The XY problem is: I’m using dune utop interactively; it is dumping out lots of data, which instead of being outputted by printf, I’d prefer to output HTML/DOM/React components.


You may find this useful: OCaml Jupyter | An OCaml kernel for Jupyter notebook - I don’t think it’s using utop as the repl, but perhaps there’s a way to adapt it, as well as provide the auto-completion features you’re seeking.

Another non-utop idea: run dune runtest --auto-promote --watch together with ppx_expect’s [%expect {| ... |}] boxes. :slight_smile: (Wouldn’t support non-text output without extra work on editor integration.)