package htmlfromtexbooks
From TeX To Human-Readable HTML
Install
Dune Dependency
Authors
Maintainers
Sources
v3.3.2.tar.gz
md5=8eafd939e9dbcb31919c5be0ed144840
sha512=4e7d13452e0a6b358e013711085500d82faf034eb03845be7de86a631fbc7b66a9aede7eba63cfd35460992c16e74de6c7db9aa152234f7dbc3acf9ab31c12ee
doc/src/htmlfromtexbooks.lib/utils.ml.html
Source file utils.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
(**Various utilities module*) (**Implementation of 4.13's OCaml String.starts_with command to be backward compatible*) let string_starts_with prefix str = if String.length prefix > String.length str then false else let a = String.sub str 0 (String.length prefix) in String.equal a prefix;; (**A simple function to transform a string into a list of its chars*) let string_to_list = fun c -> List.of_seq (String.to_seq c);; (**Simple re-usable file-reading into a list of line function*) let read_file filename = let lines = ref [] in let chan = open_in filename in try while true; do let a = input_line chan in lines := a :: !lines done; !lines with End_of_file -> close_in chan; List.rev !lines ;; (**A function to write in a output file*) let write_to_file file str = let f = open_out file in output_string f str; flush f; close_out f;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>