I entirely agree, and I think it’s very important to enable the “traditional” workflow of teams building web applications. That’s why I wanted to have a tool that would take a standard “templated HTML” file, and turn it into an OCaml module using tyxml to build the HTML.
Unfortunately, time is limited and it’s a complicated piece of code to write, so I stopped working on it. I think now all the pieces are there, so it’s time to finally do it. As @armael said, mustache’s recent additions make it a valid templating language for this job, just need to write the tyxml side.
I think I’ll free some times in the coming month to work on that, but any help is appreciated, either in tyxml directly, or to improve the mustache OCaml implementation!