Sniptest produces LazySeq

58 views
Skip to first unread message

gwanwyn

unread,
Jul 13, 2014, 5:11:05 PM7/13/14
to enliv...@googlegroups.com

I'm creating a template in enlive and having trouble with this snippet which produces LazySeq. When I try this sniptest in REPL it produces "clojure.lang.LazySeq@ba6da9f2".

    (h/sniptest (template-div) 
     [:div.Row]  (h/content (map #(value-cell %) 
     (for [e(:data-content msh-contents)] 
      (vals e)))))

The rest of the code needed to test this looks like this

    (require '[net.cgrand.enlive-html :as h])

    (def msh-contents {:title "Events mashup",
                      :data-content [{:title "ICTM Study Group ",  
                                    :url "http://some-url.com"} 
                                    {:title "Volodja Balzalorsky - Hinko Haas",
                                    :url "http://some- other-url.com"}
                                    ]})

    (defn template-div[] (h/html-resource "index.html"))

    (h/defsnippet value-cell (template-div) 
                             [:div.Row :div.Cell] [value]
                             (h/content value))

The index.html file looks something like this (it can also be found here http://www.filedropper.com/index_25))

    <div class="Table">
    <div class="Title">
    <p>This is a Table</p>
    </div>
    <div class="Heading">
    <div class="Cell">
        <p>Heading 1</p>
    </div>
    </div>
    <div class="Row">
    <div class="Cell">
        <p>Row 1 Column 1</p>
   </div>
   </div>

Not sure what causes the issue here...

Reply all
Reply to author
Forward
0 new messages