Last active
August 29, 2015 14:17
-
-
Save elrob/d0546107648c4f1c0c84 to your computer and use it in GitHub Desktop.
Enlive transformation experiment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[net.cgrand.enlive-html :as html]) | |
(def testfunc (html/transformation [:h2] (html/wrap :div) [:div] (html/set-attr "something" "value"))) | |
(html/defsnippet snippet1 "templates/jade/index.html" [:h2] [] [html/any-node] testfunc [:div] (html/set-attr "tasdf" "asdfasdf")) | |
(snippet1) | |
;;=> ({:tag :div, :attrs {"tasdf" "asdfasdf", "something" "value"}, :content [{:tag :h2, :attrs {:class "navigation-title"}, :content ["Navigation"]}]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment