Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ultralight Javascript Templating (open-lab.com)
28 points by alake1 on Sept 15, 2010 | hide | past | favorite | 3 comments


I use this rewrite of resig's microtemplating:

http://github.com/creationix/microtemplates

It's as versatile as I'll ever need - it evaluates any javascript between the tags. If you don't like the syntax it's really easy to change - just change the regexp on line 2. A complete templating engine in a dozen lines of code:

http://pastebin.com/QpacVLcS


Nice but not having loops in the templates makes for too poor a language. Still seeing it in action it looks quite fast.


Yes, the point opposed to statement-less templates is the speed, but I'm quite happy for the result :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: