package forester
A tool for tending mathematical forests
Install
Dune Dependency
Authors
Maintainers
Sources
2.1.tar.gz
md5=31749867afa21e73376e229a8f664890
sha512=297e088801dcd263cb636a9526ad31f96e1090fea8eac7a8887c115d604bafe8aa3b44a18efb8027666f0f50b53c920269e79a1cf06abcb58918643a4e18bba1
doc/src/forester.frontend/LaTeXQueue.ml.html
Source file LaTeXQueue.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
module T = Domainslib.Task module type S = sig val enqueue : name:string -> packages:string list -> source:string -> unit val process : unit -> unit end module Make (I : sig val size : int end) : S = struct let svg_queue : (string, string list * string) Hashtbl.t = Hashtbl.create I.size let enqueue ~name ~packages ~source = if not @@ Hashtbl.mem svg_queue name then Hashtbl.add svg_queue name (packages, source) let process () : unit = let n = Hashtbl.length svg_queue in let tasks = Array.make n `Uninitialized in begin let i = ref 0 in svg_queue |> Hashtbl.iter @@ fun name (packages, source) -> tasks.(!i) <- `Task (name, packages, source); i := !i + 1 end; Hashtbl.clear svg_queue; let worker i = match tasks.(i) with | `Task (name, packages, source) -> BuildLaTeX.build_latex ~name ~source ~packages | `Uninitialized -> failwith "Unexpected uninitialized task in LaTeX queue" in let pool = T.setup_pool ~num_domains:10 () in begin T.run pool @@ fun _ -> T.parallel_for pool ~start:0 ~finish:(n-1) ~body:worker end; T.teardown_pool pool; Hashtbl.clear svg_queue end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>