I have some transformations in enlive:
(html/deftemplate tranforma-numero-template "public/index.html" [m]
[:#portugues :.conteudo] (html/content (:portugues m))
[:#ingles :.conteudo] (html/content (:ingles m))
[:#espanhol :.conteudo] (html/content (:espanhol m)))
It follows a pattern. So I would like to abstract that pattern in some way. I imagine if something like this would be possible:
(html/deftemplate tranforma-numero-template "public/index.html" [m]
[(html/pred (fn [node]
(when (seq formatos)
(-> node :attrs :id (set formatos)))))] (html/content ((keyword (-> node :attrs :id)) m)))
I know this is overkill for such a simple example, but you got the concept.