Thanks to Julia’s macros and code generation features, this package compiles the templates to native code. It also preserves file&line info for easier debugging.
This is mostly a for-fun effort, but I’m hoping to eventually use if I replace StatProfilerHTML.jl’s perl backend by a pure Julia version.
Awesome, thanks so much! I’ve wanted this for a while - I’ll check it out, I’d love to add HAML templates support to Genie (happy to read that it compiles to native Julia, I was afraid it would use string parsing and evaling!).
Well, it’s obviously not actually implementing the spec because it’s a Julia-flavoured dialect. That affects, for example, the syntax for attributes.
Having said that, the parts that I haven’t done yet are:
eating whitespace with < and >
allowing non-escaped interpolations
allowing interpolations in text content
multiline with |
helper methods
Also, as a departure from haml, I’m considering disallowing literal html unless explicitly unescaped with !. Having worked in e-commerce, I’m paranoid about XSS