From 22a45b79c0f32b1ef64031caa7ab50e73c121f58 Mon Sep 17 00:00:00 2001 From: Edi Weitz Date: Mon, 9 Mar 2009 21:59:07 +0000 Subject: Dev version git-svn-id: svn://bknr.net/svn/trunk/thirdparty/cl-who@4336 4281704c-cde7-0310-8518-8e2dc76b1ff0 --- doc/index.html | 109 +++++++++++++++++++++++++++------------------------------ 1 file changed, 52 insertions(+), 57 deletions(-) (limited to 'doc/index.html') diff --git a/doc/index.html b/doc/index.html index 62a5bfd..91c9ec6 100644 --- a/doc/index.html +++ b/doc/index.html @@ -48,7 +48,7 @@ href="http://weitz.de/html-template/">HTML-TEMPLATE. I wrote this one in 2002 although at least Tim Bradshaw's htout and AllegroServe's -HTML generation facilities by John Foderaro of Franz Inc. where +HTML generation facilities by John Foderaro of Franz Inc. were readily available. Actually, I don't remember why I had to write my own library - maybe just because it was fun and didn't take very long. The syntax was obviously inspired by htout although it is slightly @@ -60,8 +60,7 @@ CL-WHO macros will usually be a sequence of WRITE-STRING forms for constant parts of the output interspersed with arbitrary code inserted by the user of the macro. CL-WHO will make sure that there aren't two adjacent WRITE-STRING forms with -constant strings - see -examples below. CL-WHO's output is +constant strings. CL-WHO's output is either XHTML (default) or 'plain' (SGML) HTML — depending on what you've set HTML-MODE to.

@@ -74,7 +73,7 @@ It comes with a BSD-style license so you can basically do with it whatever you want.

-CL-WHO is used by clutu, ERGO, and Heike Stephan. +CL-WHO is for example used by clutu and Heike Stephan.

Download shortcut: http://weitz.de/files/cl-who.tar.gz. @@ -90,7 +89,6 @@ CL-WHO is used by clutu, with-html-output

  • with-html-output-to-string -
  • show-html-expansion
  • *attribute-quote-char*
  • *prologue*
  • *html-empty-tag-aware-p* @@ -106,7 +104,6 @@ CL-WHO is used by clutu, *escape-char-p*
  • escape-string-minimal
  • escape-string-minimal-plus-quotes -
  • escape-string-iso-8859
  • escape-string-iso-8859-1
  • escape-string-all
  • escape-char-minimal @@ -146,7 +143,7 @@ together with the Lisp code generated by CL-WHO and the resulting HTML output.
    -;; Code generated by CL-WHO
    +;; code generated by CL-WHO (simplified)
     
     (let ((*http-stream* *http-stream*))
       (progn
    @@ -185,7 +182,7 @@ together with the Lisp code generated by CL-WHO and the resulting HTML output.
     
     
     
    -;; Code generated by CL-WHO
    +;; code generated by CL-WHO (simplified)
     
     (let ((*http-stream* *http-stream*))
       (progn
    @@ -226,7 +223,7 @@ together with the Lisp code generated by CL-WHO and the resulting HTML output.
     
     
     
    -;; Code generated by CL-WHO
    +;; code generated by CL-WHO (simplified)
     
     (let ((*http-stream* *http-stream*))
       (progn
    @@ -256,9 +253,9 @@ together with the Lisp code generated by CL-WHO and the resulting HTML output.
     
     CL-WHO together with this documentation can be downloaded from http://weitz.de/files/cl-who.tar.gz. The
    -current version is 0.11.0.
    +current version is 0.2.0.
     

    -The preferred method to compile and load Hunchentoot is via ASDF. +The preferred method to compile and load CL-WHO is via ASDF.

    If you're on Debian you can probably use @@ -274,6 +271,12 @@ Luís Oliveira maintains a darcs repository of CL-WHO at http://common-lisp.net/~loliveira/ediware/. +

    +You can run a test suite which tests some (but +not all) aspects of the library with +

    +(asdf:oos 'asdf:test-op :cl-who)
    +

     

    Support and mailing lists

    @@ -343,7 +346,7 @@ is transformed into an (X)HTML tag of the same (usually
    (:table :border 3) => (write-string "<table border='3' />" s)
    -
  • If it is any other form it will be left as is and later evaluated at run time and printed with If it is any other form it will be left as is and later evaluated at run time and printed like with PRINC unless the value is T or NIL which will be treated as above. (It is the application developer's job to provide the correct printer control variables.)
    ;; simplified example, see function CHECKBOX below
    @@ -403,11 +406,10 @@ CHECKBOX
     
     
    :hr => (write-string "<hr />" s)
    -
  • A form which is neither a string nor a keyword nor a list beginning with a keyword will be left as is except for the following substitutions: +
  • A form which is neither a string nor a keyword nor a list beginning with a keyword will be left as is except for the following local macros:
      -
    • Forms that look like (str form1 form*) will be substituted with - (let ((result form1)) (when result (princ result s))).
      - (Note that all forms behind form1 are ignored.) +
    • Forms that look like (str form) will be substituted with + (let ((result form)) (when result (princ result s))).
      (loop for i below 10 do (str i)) => 
       (loop for i below 10 do
      @@ -417,10 +419,10 @@ CHECKBOX
             
    • Forms that look like (fmt form*) will be substituted with (format s form*).
      (loop for i below 10 do (fmt "~R" i)) => (loop for i below 10 do (format s "~R" i))
      -
    • Forms that look like (esc form1 form*) will be substituted with - (let ((result form1)) (when result (write-string (escape-string result s)))). +
    • Forms that look like (esc form) will be substituted with + (let ((result form)) (when result (write-string (escape-string result s)))). -
    • If a form looks like (htm form*) then each of the forms will be subject to the transformation rules we're just describing. +
    • If a form looks like (htm form*) then each of the forms will be subject to the transformation rules we're just describing, i.e. this is the body is wrapped with another invocation of WITH-HTML-OUTPUT.
      (loop for i below 100 do (htm (:b "foo") :br))
           => (loop for i below 100 do (progn (write-string "<b>foo</b><br />" s)))
      @@ -438,8 +440,35 @@ CL-WHO exports the following symbols:


      [Macro]
      with-html-output (var &optional stream &key prologue indent) declaration* form* => result* -


      -This is the main macro of CL-WHO. It will transform its body by the transformation rules described in Syntax and Semantics such that the output generated is sent to the stream denoted by var and stream. var must be a symbol. If stream is NIL it is assumed that var is already bound to a stream, if stream is not NIL var will be bound to the form stream which will be evaluated at run time. prologue should be a string (or NIL for the empty string which is the default) which is guaranteed to be the first thing sent to the stream from within the body of this macro. If prologue is T the prologue string is the value of *PROLOGUE*. CL-WHO will usually try not to insert any unnecessary whitespace in order to save bandwidth. However, if indent is true line breaks will be inserted and nested tags will be intended properly. The value of indent - if it is an integer - will be taken as the initial indentation. If it is not an integer it is assumed to mean 0. The results are the values returned by the forms. +

      This is the main macro of CL-WHO. It will transform +its body by the transformation rules described +in Syntax and Semantics such that the +output generated is sent to the stream denoted +by var +and stream. var must be a +symbol. If stream is NIL it is +assumed that var is already bound to a stream, +if stream is +not NIL var will be bound to the +form stream which will be evaluated at run +time. prologue should be a string +(or NIL for the empty string which is the default) which +is guaranteed to be the first thing sent to the stream from within the +body of this macro. If prologue is T +the prologue string is the value +of *PROLOGUE*. CL-WHO will +usually try not to insert any unnecessary whitespace in order to save +bandwidth. However, if indent is true +line breaks will be inserted and nested tags will be indented +properly. The value of indent - if it is an +integer - will be taken as the initial indentation. If it is not an +integer it is assumed to mean 0. (But note that +indentation might change the semantics of the generated HTML. This is +for example the case for the PRE +and TEXTAREA tags, and in certain situations additional +whitespace might also change the layout of tables.) +The results are the values returned by +the forms.

      Note that the keyword arguments prologue and indent are used at macro expansion time. @@ -473,7 +502,7 @@ Note that the keyword arguments prologue and indent This is just a thin wrapper around WITH-HTML-OUTPUT. Indeed, the wrapper is so thin that the best explanation probably is to show its definition:

       (defmacro with-html-output-to-string ((var &optional string-form
      -                                           &key (element-type 'character)
      +                                           &key (element-type ''character)
                                                       prologue
                                                       indent)
                                             &body body)
      @@ -486,34 +515,6 @@ into Lisp code which creates the corresponding HTML as a string."
       Note that the results of this macro are determined by the behaviour of WITH-OUTPUT-TO-STRING.
       
      -


      [Macro] -
      show-html-expansion (var &optional stream &key prologue indent) declaration* form* => <no values> - -


      -This macro is intended for debugging purposes. It'll print to *STANDARD-OUTPUT* the code which would have been generated by WITH-HTML-OUTPUT had it been invoked with the same arguments. - -
      -* (show-html-expansion (s)
      -    (:html
      -     (:body :bgcolor "white"
      -      (:table
      -       (:tr
      -        (dotimes (i 5)
      -          (htm (:td :align "left"
      -                (str i)))))))))
      -(LET ((S S))
      -  (PROGN
      -    (WRITE-STRING
      -      "<html><body bgcolor='white'><table><tr>" S)
      -    (DOTIMES (I 5)
      -      (PROGN
      -        (WRITE-STRING "<td align='left'>" S)
      -        (PRINC I S)
      -        (WRITE-STRING "</td>" S)))
      -    (WRITE-STRING "</tr></table></body></html>" S)))
      -
      -
      -


      [Special variable]
      *attribute-quote-char* @@ -629,8 +630,6 @@ This is the default for the test keyword argument to [Function]
      escape-string-iso-8859-1 string => escaped-string
      [Function] -
      escape-string-iso-8859 string => escaped-string -
      [Function]
      escape-string-all string => escaped-string
      [Function]
      escape-char-minimal character => escaped-string @@ -661,10 +660,6 @@ functions are defined in a way similar to this one: (or (find char "<>&'\"") (> (char-code char) 255))))) -(defun escape-string-iso-8859 (string) - "Identical to ESCAPE-STRING-ISO-8859-1. Kept for backward compatibility." - (escape-string-iso-8859-1 string)) - (defun escape-string-all (string) "Escapes all characters in STRING which aren't in the 7-bit ASCII character set." @@ -800,7 +795,7 @@ Thanks to Stefan Scholl for the 'old school' patch. Thanks to Mac Chan for several useful additions.

      -$Header: /usr/local/cvsrep/cl-who/doc/index.html,v 1.58 2007/08/24 08:01:40 edi Exp $ +$Header: /usr/local/cvsrep/cl-who/doc/index.html,v 1.68 2009/03/09 21:54:11 edi Exp $

      BACK TO MY HOMEPAGE -- cgit v1.2.3