package yocaml
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Core engine of the YOCaml Static Site Generator
Install
dune-project
Dependency
Authors
Maintainers
Sources
yocaml-2.4.1.tbz
sha256=cfc7c139116d6881b1d0bc7af706b8f8ceb6cd1f5be67d621944388731ab9d6c
sha512=9d1a075a6a9d3c8bae9ae4e389ada0a5b7818b3993ef9dd45af65070434b86bb56c349db5d0149134d449495415c28e2bfca993a20d5e4b7d16263f7231334c3
doc/src/yocaml/cmd.ml.html
Source file cmd.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(* YOCaml a static blog generator. Copyright (C) 2024 The Funkyworkers and The YOCaml's developers This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>. *) type value = Path of { watched : bool; path : Path.t } | String of string type arg = | Flag of { prefix : string; name : string } | Param of { prefix : string ; suffix : string option ; name : string ; value : value } | Plain of value type t = { command : string; args : arg list } let param_to_string = function | String s -> s | Path { path; _ } -> Path.to_string path let arg_to_string = function | Flag { prefix; name } -> [ prefix ^ name ] | Param { prefix; suffix = Some suffix; name; value } -> [ prefix ^ name ^ suffix ^ param_to_string value ] | Param { prefix; suffix = None; name; value } -> [ prefix ^ name; param_to_string value ] | Plain value -> [ param_to_string value ] let args_to_string args = args |> List.concat_map arg_to_string let flag ?(prefix = "-") name = Flag { prefix; name } let param ?(prefix = "--") ?suffix name value = Param { prefix; suffix; name; value } let arg x = Plain x let string value = String value let int value = string (string_of_int value) let char value = string (String.make 1 value) let float value = string (string_of_float value) let bool value = string (string_of_bool value) let list ?(sep = " ") xs = xs |> String.concat sep |> string let path ?(watched = false) path = Path { watched; path } let watched x = path ~watched:true x let make command args = { command; args } let s = string let i = int let c = char let f = float let p = path let w = watched let to_string { command; args } = command ^ " " ^ (args_to_string args |> String.concat " ") let pp ppf cmd = Format.fprintf ppf "%s" (to_string cmd) let pp_arg ppf arg = Format.fprintf ppf "%a" (Format.pp_print_list ~pp_sep:(fun ppf () -> Format.fprintf ppf " ") Format.pp_print_string) (arg_to_string arg) let deps_of { args; _ } = List.filter_map (function | Plain (Path { watched = true; path }) | Param { value = Path { watched = true; path }; _ } -> Some path | _ -> None) args let normalize { command; args } = (command, args_to_string args)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>