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.core/Sem.ml.html
Source file Sem.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
open Base open Prelude type attr = string * string [@@deriving show] type node = | Text of string | Transclude of int * transclusion_mode * addr | Link of {dest : string; title : t} | Tag of string * t | Math of math_mode * t | EmbedTeX of {packages : string list; source : t} | Block of t * t [@@deriving show] and t = node list and env = t Env.t [@@deriving show] and clo = Clo of env * string list * Syn.t [@@deriving show] let sentence_case = function | Text str :: xs -> Text (StringUtil.sentence_case str) :: xs | xs -> xs type doc = {title : t option; taxon : string option; authors : addr list; date: Date.t option; addr : addr; metas : (string * t) list; body : t} [@@deriving show] module Doc = struct let peek_title (doc : doc) = match doc.title with | Some (Text txt :: _) -> Some txt | _ -> None let sort = let by_date = Fun.flip @@ Compare.under (fun x -> x.date) @@ Compare.option Date.compare in let by_title = Compare.under peek_title @@ Compare.option String.compare in let by_addr = Compare.under (fun x -> x.addr) String.compare in List.sort @@ Compare.cascade by_date @@ Compare.cascade by_title by_addr end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>