2
我正在尝试使用CL-MUSTACHE。渲染原子变量工作正常,之后在README文件的例子:如何将一个列表传递给cl-mustache?
> (mustache:mustache-render-to-string "{{year}}-{{month}}-{{day}}"
'((:year . "2012")
(:month . "07")
(:day . "02")))
"2012-07-02"
但是,我无法弄清楚如何通过列表来渲染一节多次。 README文件没有示例,我尝试的方法不起作用。例如:
(mustache:mustache-render-to-string "{{#dates}}{{year}}-{{month}}-{{day}}
{{/dates}}"
'((:dates . (((:year . "2012")
(:month . "07")
(:day . "02"))
((:year . "2013")
(:month . "08")
(:day . "03"))))))
"--
"