emacs.d/clones/lisp/www.cliki.net/LSP.html
2022-10-07 15:47:14 +02:00

101 lines
No EOL
5.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CLiki: LSP</title>
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
href="https://www.cliki.net/site/feed/article.atom?title=LSP">
<link rel="stylesheet" href="static/css/style.css">
<link rel="stylesheet" href="static/css/colorize.css">
</head>
<body>
<span class="hidden">CLiki - LSP</span>
<div id="content"><div id="content-area"><div id="article-title">LSP</div><div id="article"><a href="https://github.com/wiseman/lsp">LSP</a> (Lisp Server Pages) is an <a href="HTML&#32;template.html" class="category">HTML template</a> library.<p>LSP is copyright <a href="http://www.inetmi.com/">I/NET</a> and is
licensed under the <a href="MIT-LICENSE.html" class="internal">MIT License</a>. It was written by <a href="John&#32;Wiseman.html" class="internal">John Wiseman</a>, who discusses it in <a href="http://lemonodor.com/archives/000128.html">this blog post</a>.<p>LSP is designed to work with a separate web server library. The code
comes with support for both the <a href="AllegroServe.html" class="internal">AllegroServe</a> and <a href="Araneida.html" class="internal">Araneida</a>
servers, but it shouldn't be difficult to add support for other
libraries (see <tt>lsp-aserve.lisp</tt> and
<tt>lsp-allegroserve.lisp</tt> from the distribution for examples).<p>LSP itself should be portable <a href="ANSI.html" class="internal">ANSI</a> Lisp code that will run in any Lisp
implementation.<p>Example of publishing an LSP file:<p><div class="code"><span class="nonparen"><span class="paren1">(<span class="nonparen">publish-lsp <span class="keyword">:path</span> <span class="string">"/temperature.html"</span>
<span class="keyword">:file</span> <span class="string">"/Users/wiseman/src/temperature.lsp"</span>
<span class="keyword">:server</span> <span class="special">*my-server-or-http-listener*</span></span>)</span></span></div><p>Example of an LSP file:<p><pre>
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;LSP Example (AllegroServe)&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;LSP Example&lt;/h1&gt;
&lt;h2&gt;User Agent&lt;/h2&gt;
&lt;%=
(:princ-safe (or (net.aserve:header-slot-value request
:user-agent)
&quot;None.&quot;))
%&gt;
&lt;h2&gt;Referrer&lt;/h2&gt;
&lt;%=
(:princ-safe (or (net.aserve:header-slot-value request
:referer)
&quot;None.&quot;))
%&gt;
&lt;h2&gt;Query Variables&lt;/h2&gt;
&lt;table&gt;
&lt;%
(let ((queries (request-query request)))
(if (null queries)
(html (:tr (:td &quot;None.&quot;)))
(dolist (query queries)
(html
(:tr (:td (:princ-safe (car query)))
(:td (:princ-safe (cdr query))))))))
%&gt;
&lt;/table&gt;
&lt;h2&gt;Loop Of Dynamism&lt;/h2&gt;
&lt;% (dotimes (i (+ (random 10) 1)) %&gt;
Hi!&lt;br&gt;
&lt;% ) %&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre><p><a href="CL-EMB.html" class="internal">CL-EMB</a> uses some code from LSP, but does more. However, it requires passing the "environment" as a plist to the rendering function. See <a href="https://common-lisp.net/project/cl-emb/README">the README for CL-EMB</a>.<p><a href="Hunchentoot&#32;LSP.html" class="internal">Hunchentoot LSP</a> is a port of LSP that targets the <a href="Hunchentoot.html" class="internal">Hunchentoot</a> webserver.<p>See <a href="Lisp&#32;Server&#32;Pages.html" class="internal">Lisp Server Pages</a> for a more serious attempt at doing this right, by <a href="Sunil&#32;Mishra.html" class="internal">Sunil Mishra</a> and Tim Bradshaw.</div></div>
<div id="footer" class="buttonbar"><ul><li><a href="LSP.html">Current version</a></li>
<li><a href="https://www.cliki.net/site/history?article=LSP">History</a></li>
<li><a href="https://www.cliki.net/site/backlinks?article=LSP">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=LSP&amp;from-revision=3808878555">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
</div>
<div id="header-buttons" class="buttonbar">
<ul>
<li><a href="https://www.cliki.net/">Home</a></li>
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
<li><a href="CLiki.html">About</a></li>
<li><a href="Text&#32;Formatting.html">Text Formatting</a></li>
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
</ul>
<div id="search">
<form action="https://www.cliki.net/site/search">
<label for="search_query" class="hidden">Search CLiki</label>
<input type="text" name="query" id="search_query" value="" />
<input type="submit" value="search" />
</form>
</div>
</div>
<div id="pageheader">
<div id="header">
<span id="logo">CLiki</span>
<span id="slogan">the common lisp wiki</span>
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
<label for="login_name" class="hidden">Account name</label>
<input type="text" name="name" id="login_name" class="login_input" />
<label for= "login_password" class="hidden">Password</label>
<input type="password" name="password" id="login_password" class="login_input" />
<input type="submit" name="login" value="login" id="login_submit" /><br />
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
</form>
</div>
</div>
</div>
</body></html>