package forester
A tool for tending mathematical forests
Install
Dune Dependency
Authors
Maintainers
Sources
4.3.1.tar.gz
md5=d1623b2919d2984bfcd841b5e772abd1
sha512=5924c8822d7e5a7bc49eb2b451cfd06cb372415559bc5ff232a59395b0aa28eb9819e351426ab25510f7d96ffb85ec652fa1878478b046c61e51ff471c285710
doc/src/forester.core/Xml_tree.ml.html
Source file Xml_tree.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 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
open Forester_prelude open Base type xml_attr = {key : xml_qname; value : string} [@@deriving repr] type 'content attribution = | Author of 'content | Contributor of 'content [@@deriving repr] type date_ = { addr : addr option; year : int; month : int option; day : int option } [@@deriving repr] type date = | Date of date_ [@@deriving repr] type 'content meta_ = { key : string; body : 'content } [@@deriving repr] type 'content meta = | Meta of 'content meta_ [@@deriving repr] type 'content xml_tag = { name : xml_qname; attrs : xml_attr list; content : 'content } [@@deriving repr] type ref = { addr : addr; taxon : string option; number : string option } [@@deriving repr] type 'content local_link = { addr : addr; content : 'content; title : string option } [@@deriving repr] type 'content external_link = { href : string; content : 'content; title : string option; } [@@deriving repr] type tex = { display : [`Inline | `Block]; body : string } [@@deriving repr] type inline_img = { format : string; base64 : string } [@@deriving repr] type img = | Inline of inline_img | Remote of string [@@deriving repr] type resource_source = { type_ : string; part : string; source : string } [@@deriving repr] type 'content resource = { hash : string; content : 'content; sources : resource_source list } [@@deriving repr] type ('content, 'tree) content_node = | Text of string | CDATA of string | Xml_tag of 'content xml_tag | Prim of Prim.t * 'content | Subtree of 'tree | Ref of ref | Local_link of 'content local_link | External_link of 'content external_link | TeX of tex | Img of img | Resource of 'content resource | Info of string [@@deriving repr] type 'content frontmatter = { title : 'content option; title_text : string option; anchor : string option; number : string option; taxon : string option; designated_parent : string option; metas : 'content meta list; addr : addr option; source_path : string option; dates : date list; last_changed : date option; attributions : 'content attribution list } [@@deriving repr] type tree_options = { toc : bool; numbered : bool; show_heading : bool; show_metadata : bool; expanded : bool; root : bool } [@@deriving repr] type 'content tree = { options : tree_options; frontmatter : 'content frontmatter; mainmatter : 'content; backmatter : 'content tree list } let tree_t content_t = let open Repr in mu @@ fun tree_t -> record "tree" (fun options frontmatter mainmatter backmatter -> { options; frontmatter; mainmatter; backmatter; }) |+ field "options" tree_options_t (fun t -> t.options) |+ field "frontmatter" (frontmatter_t content_t)(fun t -> t.frontmatter) |+ field "mainmatter" content_t(fun t -> t.mainmatter) |+ field "backmatter" (list (tree_t))(fun t -> t.backmatter) |> sealr (* Tie the knot *) type tree_ = Tree of content tree [@@deriving repr] and content = Content of (content, tree_) content_node list [@@deriving repr] let splice (Content xs) = xs let splice_tree (Tree tree) = tree
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>