Skip to content

Instantly share code, notes, and snippets.

@elrob
elrob / enlive_transformation
Last active August 29, 2015 14:17
Enlive transformation experiment
(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"]}]})

Keybase proof

I hereby claim:

  • I am elrob on github.
  • I am rspeller (https://keybase.io/rspeller) on keybase.
  • I have a public key whose fingerprint is 1D42 0588 F6D7 4029 F312 9FAE 8378 C285 E97A 7A5F

To claim this, I am signing this object: