weavejester / hiccup

Fast library for rendering HTML in Clojure
http://weavejester.github.io/hiccup
Eclipse Public License 1.0
2.68k stars 174 forks source link

cross hiccup & mustache ideas #115

Closed niquola closed 9 years ago

niquola commented 9 years ago

@weavejester, what is your opinion about logic-less templates like mustache? Is it possible to cross this ideas with hiccup and save data nature of templates:

[:ul
  ['for ['x 'xs]
     [:li  ['link-to ['x :uri] ['x :title]]]]

;; compiled into
(fn [xs] 
   [:ul
     (for [x xs] 
        [:li (link-to (x :uri) (x :title))])])

;; link-to and for could be registered in compiler
weavejester commented 9 years ago

If you want to have a go at writing a library like this, go ahead. I don't think it should be part of the Hiccup library, though.

niquola commented 9 years ago

Ok, thx