package quickterface
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Quick-to-program app interfaces in OCaml for terminal and web
Install
dune-project
Dependency
Authors
Maintainers
Sources
quickterface-0.1.0.tbz
sha256=8261e3819564fb5d05f1f313e62b73382152591d7a4349ae5b1b08a4fc2469f3
sha512=e739a971bb0e696ab716c168419c59a3d195922d2d1e4963106a845e3442ffa085b05106f36cceeec9b806bf7d6ef2c31e98db04911fbf73c5ac0ce626449d0f
doc/src/quickterface_web_app_backend/head.ml.html
Source file head.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60open! Core open! Js_of_ocaml type t = { title : Dom_html.titleElement Js.t } let create_title_element document = let element = Dom_html.createTitle document in element let create_stylesheet_element document = let style_element = Dom_html.createStyle document in let css_string = Stylesheet.css_string in style_element##.innerHTML := Js.string css_string; style_element let create_viewport_meta_element document = let meta_element = Dom_html.createMeta document in meta_element##.name := Js.string "viewport"; meta_element##.content := Js.string "width=device-width, initial-scale=1.0, maximum-scale=1.0, \ user-scalable=no"; meta_element let create_charset_meta_element document = let meta_element = Dom_html.createMeta document in meta_element##setAttribute (Js.string "charset") (Js.string "UTF-8"); meta_element let add_and_await_katex_elements document ~parent = (* TODO-someday: Waiting for katex to load before starting the app could cause noticeable start-up delays. Perhaps in future we could use the auto-render functionality to allow the app to start running before katex is ready. *) let katex_setup_elements = Katex_setup.make ~document |> Katex_setup.await_elements in let%lwt () = List.map ~f: (Utils.Await_load_element .add_element_as_child_to_parent_and_wait_for_load ~parent) katex_setup_elements |> Lwt.join in Lwt.return () let make ~document () = let title = create_title_element document in Dom.appendChild document##.head title; Dom.appendChild document##.head (create_stylesheet_element document); Dom.appendChild document##.head (create_viewport_meta_element document); Dom.appendChild document##.head (create_charset_meta_element document); let%lwt () = add_and_await_katex_elements document ~parent:document##.head in Lwt.return { title } let set_title { title; _ } text () = title##.innerText := Js.string text; Lwt.return ()
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>