LSP (Lisp Server Pages) is an HTML template library.

LSP is copyright I/NET and is licensed under the MIT License. It was written by John Wiseman, who discusses it in this blog post.

LSP is designed to work with a separate web server library. The code comes with support for both the AllegroServe and Araneida servers, but it shouldn't be difficult to add support for other libraries (see lsp-aserve.lisp and lsp-allegroserve.lisp from the distribution for examples).

LSP itself should be portable ANSI Lisp code that will run in any Lisp implementation.

Example of publishing an LSP file:

(publish-lsp :path "/temperature.html" :file "/Users/wiseman/src/temperature.lsp" :server *my-server-or-http-listener*)

Example of an LSP file:

<title>LSP Example (AllegroServe)</title>
<h1>LSP Example</h1>

<h2>User Agent</h2>
  (:princ-safe (or (net.aserve:header-slot-value request

  (:princ-safe (or (net.aserve:header-slot-value request

<h2>Query Variables</h2>
(let ((queries (request-query request)))
  (if (null queries)
    (html (:tr (:td "None.")))
    (dolist (query queries)
       (:tr (:td (:princ-safe (car query)))
	    (:td (:princ-safe (cdr query))))))))

<h2>Loop Of Dynamism</h2>

<% (dotimes (i (+ (random 10) 1)) %>
<% ) %>

CL-EMB uses some code from LSP, but does more. However, it requires passing the "environment" as a plist to the rendering function. See the README for CL-EMB.

Hunchentoot LSP is a port of LSP that targets the Hunchentoot webserver.

See Lisp Server Pages for a more serious attempt at doing this right, by Sunil Mishra and Tim Bradshaw.