# HTML templating a la Mustache?

**URL:** <https://discuss.ocaml.org/t/html-templating-a-la-mustache/12631>\
**Category:** Ecosystem\
**Tags:** web\
**Created:** [July 17, 2023, 12:45pm UTC](https://discuss.ocaml.org/t/html-templating-a-la-mustache/12631 "2023-07-17T12:45:34Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![cemerick](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/cemerick/32/1383_2.png) [@cemerick](https://discuss.ocaml.org/u/cemerick)\
**Post date:** [July 17, 2023, 2:27pm UTC](https://discuss.ocaml.org/t/html-templating-a-la-mustache/12631/3 "2023-07-17T14:27:32Z")

</div>

My personal recommendation is tyxml via its jsx ppx. This allows you to write your templates in `.re` files, and thus use a very natural HTML syntax, interspersing OCaml values as needed using the tyxml APIs for those times when simple interpolation of values isn’t sufficient. There was some recent-ish discussion around this topic, e.g. [Htmx/hc web development approach - #16 by cemerick](https://discuss.ocaml.org/t/htmx-hc-web-development-approach/9993/16), and a pile of replies further downthread.

---

_[View the full topic](https://discuss.ocaml.org/t/html-templating-a-la-mustache/12631)._
