From 242b48efa026ba6ce106f1571a2aba64cec188bc Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Mon, 23 Jun 2003 20:39:03 +0000 Subject: [PATCH] r5177: *** empty log message *** --- base.lisp | 39 ++++++++++++++++++++++----------------- data.lisp | 21 +++++++++++++++------ package.lisp | 8 ++++---- stdsite.lisp | 19 ++++++++++--------- 4 files changed, 51 insertions(+), 36 deletions(-) diff --git a/base.lisp b/base.lisp index 3105af8..233d6ee 100644 --- a/base.lisp +++ b/base.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: base.lisp,v 1.2 2003/06/20 04:46:54 kevin Exp $ +;;;; $Id: base.lisp,v 1.3 2003/06/23 20:37:43 kevin Exp $ ;;;; ;;;; This file, part of LML, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -45,25 +45,32 @@ (defun lml-print-date (date) (lml-write-string (date-string date))) -(defmacro xhtml-prologue () - `(progn - (lml-write-string (xml-prologue-string)) - (lml-write-char #\newline) - (lml-write-string (xhtml-prologue-string)) +(defun html-prologue (&optional (format :xhtml11)) + (case format + ((:xhtml :xhtml11 :xhtml10-strict :xhtml10-transitional :xhtml10-frameset) + (lml-write-string +xml-prologue-string+) (lml-write-char #\newline))) - -(defmacro print-page (title &body body) - `(html - (:head - (:title (:princ ,title))) - (:body ,@body))) - -(defmacro page (out-file &body body) + (ecase format + ((:xhtml11 :xhtml) + (lml-write-string +xhtml11-dtd-string+)) + (:xhtml10-strict + (lml-write-string +xhtml10-strict-dtd-string+)) + (:xhtml10-transitional + (lml-write-string +xhtml10-transitional-dtd-string+)) + (:xhtml10-frameset + (lml-write-string +xhtml10-frameset-dtd-string+)) + (:html + (lml-write-string +html4-dtd-string+))) + (lml-write-char #\newline)) + + +(defmacro page ((out-file &key (format :xhtml11)) + &body body) `(with-open-file (*html-stream* (lml-file-name ,out-file :output) :direction :output :if-exists :supersede) - (xhtml-prologue) + (html-prologue ,format) (html ((:html :xmlns "http://www.w3.org/1999/xhtml") ,@body)))) @@ -77,5 +84,3 @@ (defmacro alink-c (class url desc) `(html ((:a :class ,class :href ,url) ,desc))) - -(export '(alink alink-c)) diff --git a/data.lisp b/data.lisp index 58aee92..9a286ce 100644 --- a/data.lisp +++ b/data.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: data.lisp,v 1.1 2003/06/20 04:12:29 kevin Exp $ +;;;; $Id: data.lisp,v 1.2 2003/06/23 20:37:43 kevin Exp $ ;;;; ;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -23,11 +23,20 @@ (defvar *print-spaces* nil) (defvar *indent* 0) -(defun html4-prologue-string () - "") - -(defun xml-prologue-string () +(defvar +xml-prologue-string+ "") -(defun xhtml-prologue-string () +(defvar +html4-dtd-string+ + "") + +(defvar +xhtml11-dtd-string+ "") + +(defvar +xhtml10-strict-dtd-string+ + "") + +(defvar +xhtml10-transitional-dtd-string+ + "") + +(defvar +xhtml10-frameset-dtd-string+ + "") diff --git a/package.lisp b/package.lisp index db700bc..f9838db 100644 --- a/package.lisp +++ b/package.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: June 2003 ;;;; -;;;; $Id: package.lisp,v 1.1 2003/06/20 04:12:29 kevin Exp $ +;;;; $Id: package.lisp,v 1.2 2003/06/23 20:37:43 kevin Exp $ ;;;; ;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -26,8 +26,6 @@ ;; base.lisp #:*print-spaces* #:reset-indent - #:with - #:print-page #:page #:lml-format #:lml-print @@ -36,7 +34,9 @@ #:lml-write-string #:lml-print-date #:*html-output* - + #:alink + #:alink-c + ;; htmlgen.lisp #:html #:html-print #:html-print-subst #:html-print-list #:html-print-list-subst #:html-stream #:*html-stream* diff --git a/stdsite.lisp b/stdsite.lisp index 0870163..c7b96d7 100644 --- a/stdsite.lisp +++ b/stdsite.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: stdsite.lisp,v 1.3 2003/06/23 20:08:06 kevin Exp $ +;;;; $Id: stdsite.lisp,v 1.4 2003/06/23 20:37:43 kevin Exp $ ;;;; ;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -62,20 +62,21 @@ (std-footer ,file)))))))) -(defmacro print-std-page (file title &body body) +(defmacro print-std-page (file title format &body body) `(progn - (xhtml-prologue) - (html - ((:html :xmlns "http://www.w3.org/1999/xhtml") - (std-head ,title) - (std-body ,file ,@body))))) + (html-prologue ,format) + (html + ((:html :xmlns "http://www.w3.org/1999/xhtml") + (std-head ,title) + (std-body ,file ,@body))))) -(defmacro std-page (out-file title &body body) +(defmacro std-page ((out-file title &key (format :xhtml11)) + &body body) `(let ((*indent* 0)) (with-open-file (*html-stream* (lml-file-name ,out-file :output) :direction :output :if-exists :supersede) - (print-std-page (lml-file-name ,out-file :source) ,title ,@body)))) + (print-std-page (lml-file-name ,out-file :source) ,title ,format ,@body)))) (defmacro titled-pre-section (title &body body) `(progn -- 2.34.1