package forester
A tool for tending mathematical forests
Install
Dune Dependency
Authors
Maintainers
Sources
2.3.tar.gz
md5=00fff94216aacd334351c2b1741d5246
sha512=724770d12a91674da76cc7842020ce7af2d37950d4429fe1ffac3b05d73a2079648f00c8eb33595e3dfa4874b2cd6b6a8c9d1f9034276a00b44d302091630cdb
doc/src/forester.render/RenderEff.ml.html
Source file RenderEff.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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
open Core module type Handler = sig val route : addr -> string val abs_path : addr -> string option val is_root : addr -> bool val backlinks : addr -> Sem.doc list val bibliography : addr -> Sem.doc list val parents : addr -> Sem.doc list val contributors : addr -> string list val contributions : addr -> Sem.doc list val enqueue_latex : name:string -> packages:string list -> source:string -> unit val get_doc : addr -> Sem.doc option val run_query : Sem.t Query.t -> Sem.doc list end type _ Effect.t += | Route : addr -> string Effect.t | AbsPath : addr -> string option Effect.t | IsRoot : addr -> bool Effect.t | Backlinks : addr -> Sem.doc list Effect.t | Related : addr -> Sem.doc list Effect.t | Bibliography : addr -> Sem.doc list Effect.t | Parents : addr -> Sem.doc list Effect.t | Contributions : addr -> Sem.doc list Effect.t | Contributors : addr -> string list Effect.t | EnqueueLaTeX : {name : string; packages : string list; source : string} -> unit Effect.t | GetDoc : addr -> Sem.doc option Effect.t | RunQuery : Sem.t Query.t -> Sem.doc list Effect.t module Perform : Handler = struct let route addr = Effect.perform @@ Route addr let abs_path addr = Effect.perform @@ AbsPath addr let is_root addr = Effect.perform @@ IsRoot addr let backlinks addr = Effect.perform @@ Backlinks addr let addr = Effect.perform @@ Related addr let bibliography addr = Effect.perform @@ Bibliography addr let contributions addr = Effect.perform @@ Contributions addr let parents addr = Effect.perform @@ Parents addr let contributors addr = Effect.perform @@ Contributors addr let enqueue_latex ~name ~packages ~source = Effect.perform @@ EnqueueLaTeX {name; packages; source} let get_doc addr = Effect.perform @@ GetDoc addr let run_query query = Effect.perform @@ RunQuery query end module Run (H : Handler) = struct let run f = Effect.Deep.try_with f () @@ {effc = fun (type a) (eff : a Effect.t) -> let resume x = Option.some @@ fun (k : (a, _) Effect.Deep.continuation) -> Algaeff.Fun.Deep.finally k @@ fun () -> x () in match eff with | Route addr -> resume @@ fun () -> H.route addr | AbsPath addr -> resume @@ fun () -> H.abs_path addr | IsRoot addr -> resume @@ fun () -> H.is_root addr | Backlinks addr -> resume @@ fun () -> H.backlinks addr | Related addr -> resume @@ fun () -> H.related addr | Bibliography addr -> resume @@ fun () -> H.bibliography addr | Parents addr -> resume @@ fun () -> H.parents addr | Contributors addr -> resume @@ fun () -> H.contributors addr | Contributions addr -> resume @@ fun () -> H.contributions addr | EnqueueLaTeX {name; packages; source} -> resume @@ fun () -> H.enqueue_latex ~name ~packages ~source | GetDoc addr -> resume @@ fun () -> H.get_doc addr | RunQuery query -> resume @@ fun () -> H.run_query query | _ -> None} end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>