YstokHTML is a collection of Common Lisp libraries for generating and parsing HTML and XHTML documents. YstokHTML is based on:
All the libraries are based on effective algorithms not relying on regular expression functions.
Both the YstokHTML generator and parser support the LHTML, the S-expression language used by the Franz's HTMLGen facility. Recently, Peter Seibel has described the FOO HTML, a similar generator syntax, in his book Practical Common Lisp.
html macro to htm (a la Edi Weitz's
CL-WHO).(htm :hr) can produce
'<hr>' or '<hr />' depending on *html-mode*.
Whether print-html-... functions produce XHTML termination '/>' also depends on *html-mode*.*html-mode* is :xml.
*html-mode* is :xml or
*attribute-case* is :downcase; so (htm ((:p class 'a)))
produces '<p class="a"></p>'.
:include, :nbsp, :jscript, :format, :format-safe,
:!doctype, :?xml.
:escape,
which invokes full-fledged html-template:escape-string
and escapes not only four characters, but all satisfying template:*escape-char-p*.:optional,
which is similar to :if*.if* macro from the htmlgen.lisp source code. html-process to descriptor:
name-attrs renamed to name-attr;
uri-attrs specifying a list of attributes of type URI.
prin1-safe-http-string replaced by generic prin1-attribute-value
of signature: (val &optional stream).
html-print-list and html-print signature: (form &optional stream).
def-std-html now defines a macro named as follows:
(intern "key")
instead of
(intern "WITH-HTML-key"),
produced by the Franz's HTMLGen.attribute-name-string and prin1-attribute-value, now
html-standard-print generates HTML close to what is produced by the
htm macro.YstokHTML is available from http://lisp.ystok.ru/yhtml/yhtml-0-3-006.zip. The distribution package contains both the ASDLite/ASDF file yhtml.asd and the LispWorks system definition file defsys.lisp.
Here is change.log.
Currently, there is no documentation on YstokHTML other than for the HTMLGen and PHTML mentioned above. However, the source code is instructive and there are the demonstration file html-examples.lisp and the test cases file phtml-test.lisp in the distribution package.
If you fail to grab the original documentation at Franz's website, try our local copies htmlgen.html and phtml.htm.
(html:with-html-stream (*standard-output*)
((:table :border 2)
(:tr ((:th :colspan 2)
(:i "The square of four integers")))
(dotimes (i 4)
(html:htm
(:tr (:td (:princ i))
(:td (:b (:princ (* i i))))))))
|
|
||||||||||