package b0
Software construction and deployment kit
Install
dune-project
Dependency
Authors
Maintainers
Sources
b0-0.0.6.tbz
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/src/b0.kit/b0_web_page.ml.html
Source file b0_web_page.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
(*--------------------------------------------------------------------------- Copyright (c) 2023 The b0 programmers. All rights reserved. SPDX-License-Identifier: ISC ---------------------------------------------------------------------------*) open B0_std open B0_html let write ?(lang = "") ?(generator = "") ?(styles = []) ?(scripts = []) ?more_head ?(title = "") m ~frag ~o = (* FIXME Ideally we would like the read to be in write. The write fun return a future but this has other impacts. *) let open Fut.Syntax in ignore @@ (* FIXME maybe get rid of that. *) let* contents = B0_memo.read m frag in let title = if title = "" then El.title_of_filepath (Fpath.to_string o) else title in let more_head = match more_head with | None -> "" | Some more_head -> El.to_string ~doctype:false more_head in let stamp = lang :: generator :: more_head :: title :: [] in let stamp = List.rev_append styles stamp in let stamp = List.rev_append scripts stamp in let stamp = String.concat "" stamp in Fut.return @@ (B0_memo.write m ~stamp ~reads:[frag] o @@ fun () -> let more_head = El.unsafe_raw more_head in let body = El.(body [unsafe_raw contents]) in let page = El.page ~lang ~generator ~styles ~scripts ~more_head ~title body in Ok (El.to_string ~doctype:true page))
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>