Hello--

I am trying to use the Ersatz egg to process templates, but I want to pass
variables from the calling environment, and it doesn't seem to work. For
example:

test.tpl
-----------
<html>
  <head>
    <title>{{ page_title }}</title>
  </head>
  <body>
     <div id="main-content">
        {{ main_content }}
     </div>
  </body>
</html>

And I use code like this:

(with-output-to-file "test.html"
  (lambda ()
    (with-input-from-string
       (from-file "test.tpl" env: (template-std-env) models:
'(("page_title" Tstr "Test Page") ("main_content" Tstr "This is the
content.")))
        (lambda () (display (read-all))))))

By the way, I can't tell from the documentation exactly what the correct
form of the 'models' argument is; I've tried numerous variations. Anyway,
the output file gets generated just fine, but the {{ * }} expressions are
simply removed--they are not replaced by the variables. So, am I doing
something wrong, or have I found a bug? Any clues appreciated!

--
Matt Gushee
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to