Closed dane-harnett closed 9 years ago
:+1:
Should be able to knock something out pretty quickly.
Just to level set, you are talking about client template support, right? Server template support would come via whichever server you choose to use.
The library you linked is definitely geared mostly towards server use. It does some fairly suboptimal things when it comes to compiling templates for the client. Going to try and do the right thing, but may botch something up.
https://github.com/dbashford/mimosa-twig
That was fun!
Purely browser support. Things like tags and functions aren't dealt with by this compiler because they don't need to be. You can simply write code in the browser to support new functions/tags.
It does, through some necessary hackery, support things like imports and blocks. As far as I can tell, the library just isn't 100% built (and optimized) for use in the UI, but its close so only a few things needed to be patched up.
If you do give it a shot, let me know how it goes. It's new to me, so I may have missed a thing or tow.
https://github.com/justjohn/twig.js/