···1type t
23-val init : id:int -> Client.t -> Webcomponent.t -> t
4val id : t -> int
5val set_source : t -> string -> unit
6val add_message : t -> int -> X_protocol.output list -> unit
···1type t
23+val init : id:int -> ?extra_style:Jstr.t -> Client.t -> Webcomponent.t -> t
4val id : t -> int
5val set_source : t -> string -> unit
6val add_message : t -> int -> X_protocol.output list -> unit
+3-1
src/x_ocaml.ml
···32 | None -> Jstr.of_string "x-ocaml"
33 | Some name -> name
340035let _ =
36 Webcomponent.define elt_name @@ fun this ->
37 let prev = match !all with [] -> None | e :: _ -> Some e in
38 let id = List.length !all in
39- let editor = Cell.init ~id worker this in
40 all := editor :: !all;
41 Cell.set_prev ~prev editor;
42 ()
···32 | None -> Jstr.of_string "x-ocaml"
33 | Some name -> name
3435+let extra_style = current_attribute "src-style"
36+37let _ =
38 Webcomponent.define elt_name @@ fun this ->
39 let prev = match !all with [] -> None | e :: _ -> Some e in
40 let id = List.length !all in
41+ let editor = Cell.init ~id ?extra_style worker this in
42 all := editor :: !all;
43 Cell.set_prev ~prev editor;
44 ()