package mustache
Mustache logic-less templates in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
v3.0.2.zip
sha256=2abfb2dcc7a901508de2423ff2ce5da677d3868866d2eaa74544f02a19fe2f4b
md5=36d6e8962432dc42c0691e27a7ec08f1
Description
Read and write mustache templates, and render them by providing a json object.
Published: 07 Aug 2017
README
ocaml-mustache
mustache.js logic-less templates in OCaml
Example usage
let tmpl =
Mustache.of_string "Hello {{name}}\n\
Mustache is:\n\
{{#qualities}}\
* {{name}}\n\
{{/qualities}}"
let json =
`O [ "name", `String "OCaml"
; "qualities", `A [ `O ["name", `String "awesome"]
; `O ["name", `String "simple"]
; `O ["name", `String "fun"]
]
]
let rendered =
Mustache.render tmpl json
Spec compliance
ocaml-mustache complies¹ to the latest mustache specification, and is automatically tested against it.
¹: except for lambdas and set delimiters tags.
Todo/Wish List
Support for ropes
http://mustache.github.io/
Dependencies (4)
- base-unsafe-string
- menhir
-
jbuilder
>= "1.0+beta7"
-
ocaml
>= "4.02.3"
Dev Dependencies
None
Used by (1)
-
soupault
< "2.0.0"
Conflicts
None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page