enlive: smashing vectors of nodes together

49 Views Asked by At

So I have finally realized that I can use selectors to limit the portions of the page nodes that enlive transforms, that way I can create vectors of non-intersecting nodes.

Lots of words to say:

(defn b-content-transform []
  (def b-area (eh/select global-page [:.b])) ;;cuts out all irrelevant nodes

  (eh/transform b-area [:.b]
    (eh/clone-for [i (range numberOfB)] 
        (eh/content (b-sample-content i)))))

So this returns something like..

[{:tag :div, :attrs {:class "b"}, :content ({:tag :div, :attrs {:id "b0", :class "topB"}]

Which is excellent, enlive nodes yay!

Now I have several transforms that act the same way.

My question is: how can I mash all the resultant vectors (?) together?

1

There are 1 best solutions below

1
sova On

Well it turns out there is a knee-slappingly simple solution:

(concat transform1 transform2 transform3)

then enlive-html/emit* .