New release CL-EMB 0.2.0
CL-EMB is a library to embed Common Lisp and special template
tags into normal text files. Can be used for dynamically
generated HTML pages.
You can download it from
http://common-lisp.net/project/cl-emb/
or install with ASDF-Install.
CL-USER> (require :asdf-install)
CL-USER> (asdf-install:install :cl-emb)
Changes:
- Debugging: CL-EMB:REGISTER-EMB saves the generated lambda form
when CL-EMB:*DEBUG* is T. You may pretty print this form with
CL-EMB:PPRINT-EMB-FUNCTION
CL-USER> (emb:register-emb "test7" " - <% @var foo -escape uri %> - ")
#<CL-EMB::EMB-FUNCTION {96F1239}>
CL-USER> (emb:pprint-emb-function "test7")
(LAMBDA (&OPTIONAL CL-EMB-INTERN::ENV)
(WITH-OUTPUT-TO-STRING (*STANDARD-OUTPUT*)
(PROGN
(WRITE-STRING " - ")
(FORMAT T "~A" (CL-EMB::ECHO (GETF CL-EMB-INTERN::ENV :FOO) :ESCAPE :URI))
(WRITE-STRING " - "))))
; No value
- New template tag @set can be used to set special variables and
establish a default for the rest of the code.
CL-USER> (emb:register-emb "test8" "<% @set escape=xml %>--<% @var hey %>--")
#<CL-EMB::EMB-FUNCTION {962B839}>
CL-USER> (emb:register-emb "test9" "--<% @var hey %>--<% @call test8 %>--<% @var hey %>--")
#<CL-EMB::EMB-FUNCTION {96931A9}>
CL-USER> (emb:execute-emb "test9" '(:hey "5>2"))
"--5>2----5>2----5>2--"