package jupyter
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
An OCaml kernel for Jupyter
Install
dune-project
Dependency
Authors
Maintainers
Sources
v3.0.1.tar.gz
md5=27079d43a5134a740428623185807029
sha512=40929cacd1ddc0379c84438bcda3edce47ab571ea27ff5f597b5e88fc38c9198cc69442e334e05c64d854763c162c2e8266497dbc413134beb71db00d11df6ce
doc/jupyter.comm/Jupyter_comm/Manager/index.html
Module Jupyter_comm.ManagerSource
User-defined communication
User-defined communication
This module provides communication of arbitrary JSON data between the OCaml REPL and the Jupyter. See Comms (Jupyter Notebook Docs) for details.
Opening a comm from the REPL
OCaml:
let target = Target.create "comm-test" in
let comm = Comm.create target in (* Send comm_open to the frontend *)
Comm.send comm (`String "Hello") ; (* Send comm_msg to the frontend *)
Comm.close comm (* Send comm_close to the frontend *)JavaScript:
Jupyter.notebook.kernel.comm_manager.register_target('comm-test', function(comm, msg){
console.log('opened comm', msg);
comm.recv_msg(function (msg) { console.log('got msg', msg); });
})Opening a comm from the frontend
OCaml:
let target = Target.create "comm-test"
~recv_open:(fun comm json -> ...) (* Receive json = `String "opening" *)
~recv_msg:(fun comm json -> ...) (* Receive json = `String "msg" *)
~recv_close:(fun comm json -> ...) (* Receive json = `String "closing" *)JavaScript:
comm = Jupyter.notebook.kernel.comm_manager.new_comm('comm-test', 'opening');
comm.send('msg');
comm.close('closing'); sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page