Changeset 3711

Show
Ignore:
Timestamp:
07/31/08 18:16:24 (4 months ago)
Author:
ksprotte
Message:

xhtmlgen does not indent anymore

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/xhtmlgen/xhtmlgen.lisp

    r3559 r3711  
    4949  (let ((body (gensym))) 
    5050    `(labels ((,body () 
    51               ,(process-html-forms forms env))) 
    52       (if (boundp '*html-sink*) 
    53          (,body) 
    54          (let ((*html-sink* (cxml:make-character-stream-sink *standard-output* :canonical nil :indentation 3))) 
    55            (,body) 
    56             (sax:end-document *html-sink*)))))) 
     51                ,(process-html-forms forms env))) 
     52      (if (boundp '*html-sink*) 
     53           (,body) 
     54           (let ((*html-sink* (cxml:make-character-stream-sink *standard-output* :canonical t))) 
     55             (,body) 
     56            (sax:end-document *html-sink*)))))) 
    5757 
    5858(defmacro html-stream (stream &rest forms &environment env) 
    59   `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical nil :indentation 3))) 
    60     ,(process-html-forms forms env) 
    61     (sax:end-document *html-sink*))) 
    62  
    63 (defmacro with-xhtml ((&optional stream &key (indentation 3)) &body body) 
    64   `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical nil :indentation ,indentation))) 
    65     (sax:start-document *html-sink*) 
    66     (sax:start-dtd *html-sink* 
    67      "html" 
    68      "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    69      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") 
    70     (sax:end-dtd *html-sink*) 
    71     (multiple-value-prog1 
    72         (html 
     59  `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical t))) 
     60     ,(process-html-forms forms env) 
     61     (sax:end-document *html-sink*))) 
     62 
     63(defmacro with-xhtml ((&optional stream &key (indentation 3 indentation-given)) &body body) 
     64  (declare (ignore indentation)) 
     65  (when indentation-given 
     66    (warn "WITH-XHTML: indentation argument is deprecated. It will be ignored")) 
     67  `(let ((*html-sink* (cxml:make-character-stream-sink ,stream :canonical t))) 
     68     (sax:start-document *html-sink*) 
     69     (sax:start-dtd *html-sink* 
     70                    "html" 
     71                    "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     72                    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd") 
     73     (sax:end-dtd *html-sink*) 
     74     (multiple-value-prog1 
     75         (html 
    7376          ,@body) 
    7477      (sax:end-document *html-sink*))))