Lua can be a really cool HTML templating engine

109 points by riki


jfred

As someone who spends a lot of time in my day job dealing with template languages that just operate on strings, techniques like this that let you write templates with structured data rather than just strings are one of my favorite things. I'm partial to Lisps myself and enjoy working with SXML, but any such design is better than string templating in my opinion! String templating whitespace-sensitive documents (hello templated YAML) is especially painful.

Those who liked this post may also like this one, along similar lines: https://www.more-magic.net/posts/structurally-fixing-injection-bugs.html