Skip to content

Commit

Permalink
Add example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrinberg committed Dec 20, 2016
1 parent 0c94248 commit a299314
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ ocaml-mustache

mustache.js logic-less templates in OCaml


Example usage
-------------

```ocaml
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
```

Todo/Wish List
-----------
* Support for ropes
Expand Down

0 comments on commit a299314

Please sign in to comment.