Generates HTML output from Lisp.
If stream is supplied, var is bound
to stream and output is written to that. If
stream is not supplied, then var
should previously have been bound to the desired
The HTML to be generated is specified in Lisp syntax.
For example, see the following (included with the
(defun create-blank-page (s title)
(:title (esc title))
(:h1 (esc title))
"<!-- Body here -->"
This generates a blank page with the given title. The
:html is output as a begin
<HTML> tag, followed by the tag
content (the rest of the list after the keyword
html), and lastly an end
</HTML> tag... and so on.
The body of
If the form is a keyword symbol it corresponds to an
element with an empty content model -
with-html-output consists of
HTML in Lisp syntax (`LHTML') and/or Lisp code. For
If the form is a list beginning with a keyword
symbol it corresponds to an element with no attributes.
If the list is empty and the element is defined as empty
(below) then no closing tag is generated.
"foo") corresponds to
If the form is a list beginning with a list which
begins with a keyword symbol it corresponds to an
element with attributes. The attributes and values are
given by keyword `arguments'.
((:a :href "foo")
"bar") corresponds to
If the form is a string it corresponds to that
literal string in the output; if the form is a character
it corresponds to that character;
Otherwise, the form is Lisp code which is evaluated
in the normal way.
with-html-output understands various
shorthands for specifying particular HTML output,
implemented as local macros:
- re-enters HTML mode, for instance
from within Lisp code. This is essentially the same
as a nested
- shorthand for
s is the stream on which
output is being generated
- escapes its argument string, quoting
things that are magic to HTML. See
- outputs a linefeed on the output stream