edwindj / whisker

{{mustache}} for R
https://mustache.github.io
213 stars 19 forks source link

Allowing specification of delimiters #5

Closed ramnathv closed 10 years ago

ramnathv commented 11 years ago

I would like to use mustache templates with latex. But the trouble is that latex makes extensive use of { and } which interferes with mustache syntax. I read in the mustache documentation that it is possible to customize delimiters. Does whisker already support it, or can it be made to support it?

edwindj commented 11 years ago

Whisker supports it partially:

(see for example the tests in [https://github.com/edwindj/whisker/tree/master/inst/tests]) most work of "testdelimiters.R", except for test 3 to 7.)

ramnathv commented 11 years ago

That is terrific. Is there a way to redefine the triple mustache as well?

edwindj commented 11 years ago

Well strictly speaking no, but there is an alternative syntax for triple mustache In stead of triple mustache '{{{name}}}' you can use '{{&name}}' which still works when changing the delimiters

(see http://mustache.github.io/mustache.5.html)

ramnathv commented 11 years ago

Awesome. Thanks!