Sweat is a simple template system. But it’s not designed to be useful anywhere outside of EmacsLISP?.
Sweat is now unmaintained by NicFerrier.
It would be best to offer an example:
(sweat-let ((title "nic's demo")) "<html><head><title>::title::</title><head><body>" "</body></html>" )
The result of this is a string which is the evaluation of the template:
sweat-let is a little like ordinary let:
Here’s a more complex example:
(sweat-let ((title "nic's demo") (items (stream-from-list (lambda (item) `((name . ,(car item)) (value . ,(cdr item)))) '(("username" . "nicferrier") ("firstname" . "nic"))))) "<html><head><title>::title::</title><head><body><ul>" (sweat-* items "<li>::name:: - ::value::</li>") "</ul></body></html>" )
This shows that you can have more complex things happening in the form list. In this case items is a stream. A stream is a function that produces items from a list it is bound to. sweat-* iterates over the stream processing the template against each item from the stream. In this case the items are binding lists.