I have a quick question. I'm working on a Clojure project. I want to add unique key to each li tag, like this:
(defn test [text]
[:li {:key :index} text])
How I can set keys like "hi+index"?
I tried
{:key (str "hi" index)}
but it does not working. I'm new to Clojure and hiccup.
Thank you very much.
You are making a mistake somewhere. When in doubt, ask the computer with some test code:
with result
I like to use this template project for quick tests like the above. Just clone it and throw some sample code into the
test/clj/tst/demo/core.clj
file, and away you go!