Closed ryancole closed 11 years ago
I think I would rather that (render "{{a}}") performed currying, than rendered with an empty data map.
So
(is (=
((render a) b)
(render a b))
Ideally, it would compile the template first.
@JulianBirch I think I'd rather have that in a separate function (e.g. compile
), since it would be inconsistent with how render
behaves with 2 or 3 parameters. (That said, I fear precompiling templates would be quite the effort, considering how clostache is implemented right now.)
Merged, thanks! I'm sorry it took a while.
I'm not sure if this is something you'd want to allow or not. I've used some other mustache template libs, in other languages, that allowed this. Anyway, I'm also new to Clojure so this may or may not be the best way to go about this. This was just a possible way to do it that I saw.
This adds another overloaded
render
andrender-resource
that simply provide an empty map if they're only passed in a single parameter.This is useful because it still allows you to take advantage of various features of this lib, even if you don't explicitly need a data map.