sstephenson / eco

Embedded CoffeeScript templates
MIT License
1.71k stars 70 forks source link

CoffeeKup as "helpers language" #27

Open clyfe opened 13 years ago

clyfe commented 13 years ago

I'd like to augment Eco, so that when a function object is given to output like so

<%- -> div class: 'big' %>

or even nicer

<%-> div class: 'big' %>

This function to be passed to the coffeekup compiler, if present. This way, coffeekup becomes a nice DSL for view helpers. Maybe have some API to plug different resolvers to different tags <%= <%- <%-> <%=> <%+> etc. ?

At the moment I know I can do

ck = coffeekup.compile
...
<%-ck -> div class: 'big' %>

But I'm mostly thinking at the zen of it.

PS. Is Eco stream-able ? meaning does it "send" the resolved chunks of the template before the rest of the template is processed (like the recent Rails streaming additions) ?