Skip to content

mustache.js logic-less templates in OCaml

License

Notifications You must be signed in to change notification settings

gasche/ocaml-mustache

 
 

Repository files navigation

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/

About

mustache.js logic-less templates in OCaml

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • OCaml 99.3%
  • Other 0.7%