This code is transformed into the following OCaml code:
let header ~children () =
header () ~children:[ h1 () ~children:[ title ] [@JSX]; ] [@JSX]
let page =
html () ~children:[
body () ~children:[
header () ~children:[ "Hello, world!" ] [@JSX];
div () ~children:[ "Some content goes here" ] [@JSX];
] [@JSX];
] [@JSX]
It is expected to use mlx-pp preprocessor with either a runtime lib which provides the implementation of such functions or a ppx which which further transforms [@JSX] attributes into the desired output.
Installation & Usage
Currently for editor integration an unreleased version of ocaml-lsp-server is needed (along with its depenedencies, jsonrpc and lsp).
Use the following commands to install the necessary packages: