X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=web-utils-aserve.lisp;h=21d1b55f9c7c434c9a74f86d6f6cf434a599175e;hb=4a7372ef4000eaaa86a987bc9668ccecf7d0489f;hp=74a518a308aee40c5f42f20f67575e68234a7c82;hpb=bb23129ae7ddabcbcb09c718545f69a52a8d1eaf;p=kmrcl.git diff --git a/web-utils-aserve.lisp b/web-utils-aserve.lisp index 74a518a..21d1b55 100644 --- a/web-utils-aserve.lisp +++ b/web-utils-aserve.lisp @@ -8,7 +8,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: web-utils-aserve.lisp,v 1.5 2002/10/16 17:37:18 kevin Exp $ +;;;; $Id: web-utils-aserve.lisp,v 1.6 2002/10/16 21:58:49 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -90,37 +90,38 @@ (setq css "http://b9.com/main.css")) (net.html.generator:html (:head - (princ-http (format nil "" css)) + (princ-http (format nil "" css)) (:title (:princ-safe title-str))))) ;;; Page wrappers -(defmacro with-xml-page (title &rest body) - `(prog1 - (progn - (net.html.generator:html - (princ-http (std-xml-header)) - (princ-http "")) - (with-tag "pagetitle" (princ-http ,title)) - ,@body) - (princ-http ""))) - -(defmacro with-html-page ((title &key css) &rest body) - `(prog1 - (progn - (print-http "") - (print-http "") - (print-http "") - (print-http "") - (head ,title :css ,css) - (print-http "") - (prog1 - ,@body - (print-http ""))) - (print-http ""))) +(defmacro with-page ((title &key css (format :html)) &rest body) + (case format + (:html + `(prog1 + (progn + (net.html.generator:html + (print-http "") + (print-http "") + (print-http "") + (print-http "") + (head ,title :css ,css) + (print-http "") + (prog1 + ,@body + (print-http "")))))) + (:xml + `(prog1 + (progn + (net.html.generator:html + (princ-http (std-xml-header)) + (princ-http "")) + (with-tag "pagetitle" (princ-http ,title)) + ,@body) + (princ-http ""))))) ;;; URL Encoding