Heist in 60 Seconds
A template system is a bridge between static data (templates) and dynamic data.
Heist is a template system bridging HTML templates and Haskell code.
A splice is code that Heist binds to an HTML tag.
Every time the tag appears in a template, Heist runs the splice bound to that tag and passes the tag (including its attributes and its children) as input to the splice.
A splice's output is a list of tags that get substituted into the template in place of the original input tag.
Splices can be thought of as functions that can be called from templates to get dynamic data.
Splices can pass this dynamic data back to templates by (temporarily) binding new splices.
<bind> is a tag you can use in your templates to create new splices on the fly.
<apply> is a tag that lets you insert one template into another.
A more in-depth tutorial is here.
Heist is a template system bridging HTML templates and Haskell code.
A splice is code that Heist binds to an HTML tag.
Every time the tag appears in a template, Heist runs the splice bound to that tag and passes the tag (including its attributes and its children) as input to the splice.
A splice's output is a list of tags that get substituted into the template in place of the original input tag.
Splices can be thought of as functions that can be called from templates to get dynamic data.
Splices can pass this dynamic data back to templates by (temporarily) binding new splices.
<bind> is a tag you can use in your templates to create new splices on the fly.
<apply> is a tag that lets you insert one template into another.
A more in-depth tutorial is here.
Comments
I know it's early days but performance of heist looks a problem at the moment. As an example I have a template that takes around 100ms to serve from JSP and it takes around 250ms in Heist / Snap and I know that snap is not taking anything like that time because a static file of the same content takes less than 60ms. That was on 0.5, on 0.5.1 it has increased to over 2 seconds ! Maybe it is my setup but 0.5.1 has something seriously wrong with it but I think 0.5 could also use some optimisation.
Andrew