Batteries for templates
Include some batteries for rendering using template engine. Instead of requiring rendering function we accept two properties: :template-engine and :template-name.
Starting with https://github.com/yogthos/Selmer. Plan is to add few more: Jade, Mustache.
@martinklepsch, @Deraen let me know what do you think about optionally adding support for the template engines.
I don't see myself using other than hiccup.
Instead of making render a monolithic task rendering with many different engines, maybe a separate task should be done for each template engine? Some thought can be given to providing some helper functions for creating render tasks so that users can easily create their own if they need some specific template engine.
@Deraen I also probably will use Hiccup most of the times. But my motivation was to make it easier for other people to start.
I was thinking about separate task that will use templates. But the problem is that than it should be at least 2 task: render-template and collection-template. I don't like it that much.
Also I feel like this implementation is quite flexible for extending. Because it works as before user may provide (render :renderer) function, that can be Hiccup rendering or anything else. What I did is to make (render :renderer) optional. So the user can either provide this function (as you or me), or use included batteries for templates (provide template name and template engine).
The things which bothers me is that if we are going to include some template engines we also need to add dependencies for them. I would like the dependencies were added only when the user is using the template engine.
If engine is going to be set using keyword, we could map keyword to dependency before creating the pod.
Btw. currently collection-deps is not used.
I like idea of mapping dependency to engine (and I agree with the argument about too much dependencies).
Thanks for pointing out that collection-deps wasnot used.
Hi, @podviaznikov,
What's the current status of this PR?
Hi, @podviaznikov Are you still interested in working on this?