- Notifications
You must be signed in to change notification settings - Fork25
mustache.js logic-less templates in OCaml
License
NotificationsYou must be signed in to change notification settings
rgrinberg/ocaml-mustache
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
mustache.js logic-less templates in OCaml
let tmpl=tryMustache.of_string"Hello {{name}}\n\ Mustache is:\n\ {{#qualities}}\ * {{name}}\n\ {{/qualities}}"withMustache.Parse_errorerr ->Format.eprintf"%a@."Mustache.pp_template_parse_error err; exit3let json=`O ["name",`String"OCaml" ;"qualities",`A [`O ["name",`String"awesome"] ;`O ["name",`String"simple"] ;`O ["name",`String"fun"] ] ]let rendered=tryMustache.render tmpl jsonwithMustache.Render_errorerr ->Format.eprintf"%a@."Mustache.pp_render_error err; exit2
ocaml-mustache accepts the whole Mustache template language, except:
- it does not support setting delimiter tags to something else than '{{' and '}}'.
- it does not support lambdas inside the provided data
It is automatically tested against the latestmustache specification testsuite.
ocaml-mustache also supports template inheritance / partials with parameters,tested against thesemi-official specification.
- Support for ropes
About
mustache.js logic-less templates in OCaml
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.