|
From: | Matt Gushee |
Subject: | Re: [Chicken-users] Trouble w/ ersatz |
Date: | Wed, 7 Nov 2012 20:35:29 -0700 |
Thanks for trying to use ersatz
and sorry for the incomplete documentation.
The models argument must be an association list, i.e. a list of dotted pairs of the form (NAME . VALUE) where NAME is a symbol and VALUE is a template value.
Your code is mostly correct, except that you are not calling the value constructors correctly. The following should work (note use of quasiquotation):
(with-output-to-file "test.html"(from-file "test.tpl" env: (template-std-env) models: `((page_title . ,(Tstr "Test Page") ) (main_content . ,(Tstr "This is the content."))))
(lambda ()
(with-input-from-string
(lambda () (display (read-all))))))
I have not yet had a chance to use ersatz a lot, so your feedback is really appreciated. Let me know if you have any other troubles.
[Prev in Thread] | Current Thread | [Next in Thread] |