This is the cl-template Reference Manual, version 0.0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:27:05 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-template
A simple output-agnostic templating system for Common Lisp.
Peter Cannici <turkchess123@gmail.com>
MIT
0.0.1
packages.lisp
(file).
util.lisp
(file).
cl-template.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-template/cl-template.asd
cl-template/packages.lisp
cl-template/util.lisp
cl-template/cl-template.lisp
cl-template/util.lisp
packages.lisp
(file).
cl-template
(system).
match-pairs-ignoring
(function).
scan-between-delimiters
(function).
scan-string-until-ignoring
(function).
cl-template/cl-template.lisp
packages.lisp
(file).
util.lisp
(file).
cl-template
(system).
*add-progn-to-if*
(special variable).
compile-template
(function).
*template-fn-cache*
(special variable).
add-progn-to-if-expression
(function).
compile-echo-expression
(function).
compile-expression
(function).
compile-string
(function).
compile-template-part
(function).
handle-end-expression
(function).
internal-compile-template
(function).
Packages are listed by definition order.
cl-template
clt
common-lisp
.
*add-progn-to-if*
(special variable).
compile-template
(function).
*template-fn-cache*
(special variable).
add-progn-to-if-expression
(function).
compile-echo-expression
(function).
compile-expression
(function).
compile-string
(function).
compile-template-part
(function).
handle-end-expression
(function).
internal-compile-template
(function).
match-pairs-ignoring
(function).
scan-between-delimiters
(function).
scan-string-until-ignoring
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Boolean; whether or not to implicitly add a progn to IF expressions.
Compile a string template into a lambda, which can be invoked with
a plist as the only argument and provides data to the template. The
data argument to the lambda is available in the template as
‘cl-template::__data‘, although it’s not recommended to use it
directly. See README.md for examples of the template syntax.
It caches the result of the compilation.
Examples:
(compile-template "the number is <%= (@ number) %>") ; (lambda (__data) ...)
(compile-template "{{= @ mood }} shark" :start-delimiter "{{" :start-echo-delimiter "{{=" :end-delimiter "}}") ; (lambda (__data) ...)
(funcall (compile-template "<%= format nil "~@r" (@ number) %>") ’(:number 12)) ; "XII"
Hash table which compiled template functions are cached in.
Count the occurences of a pair (e.g. []) in a string, ignoring any that occur in between pairs of ‘ignore-list‘.
Example:
(match-pairs-ignoring "(something)" ’(#( . #))) ; t
(match-pairs-ignoring "[that <thing]>" ’(#[ . #]) :ignore-list ’((#< . #>))) ; nil
Scan a string and return a substring between the two delimiter substrings.
Example:
(scan-between-delimiters "abc <%= thingy %> def" "<%=" "%>") ; " thingy "
(scan-between-delimiters "what{{ever stuff<ignor{{ing>{{now}}xyz" :ignore-list ’((#< . #>)) :start 10) ; "now"
Scan a string until a substring is encountered, ignoring anything
between ignore-list pairs. Probably not super-useful outside of
CLT. In CLT it is used to scan until the next end delimiter while
ignoring things in quotes.
Example:
(scan-string-until-ignoring "abc|def" "|") ; "abc"
(scan-string-until-ignoring "abc <ignor|ing> def" "|" :ignore-list ’((#< . #>))) ; "abc <ignor|ing> def"
Jump to: | A C F H I M S |
---|
Jump to: | A C F H I M S |
---|
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Jump to: | C F P S U |
---|
Jump to: | C F P S U |
---|