Several people have expressed confusion with using clone-for
to insert a list of dynamically generated elements into a template which includes several dummy elements. For example, maybe the template looks like this,
<ul>
<li>foo</li>
<li>bar</li>
<li>baz</li>
</ul>
And we want to generate HTML like this,
<ul>
<li>real</li>
<li>data</li>
<li>here</li>
<li>wurdz</li>
</ul>
The naive thing to try is something like
(defsnippet my-snippet "my-template.html" [:ul] [items]
[[:li first-of-type]] (clone-for [ii items]
[:li] (content ii)))
But that leaves the 2nd through nth elements with the dummy data. How can we simply remove all the dummy elements and replace with real one?