1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
5 ;;;; Name: stdsite.lisp
6 ;;;; Purpose: Functions to create my standard style sites
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Aug 2002
10 ;;;; $Id: stdsite.lisp,v 1.7 2003/07/12 17:54:05 kevin Exp $
12 ;;;; This file, part of LML2, is Copyright (c) 2000-2003 by Kevin Rosenberg.
13 ;;;; Rights of modification and redistribution are in the LICENSE file.
15 ;;;; *************************************************************************
18 ;;; A "standard site" is a format for a certain style of web page.
19 ;;; It is based on the LML2 package.
20 ;;; A stdsite page expects to include the following files:
28 (defmacro std-head (title &body body)
31 (:title (:princ ,title))
32 (lml-load "header.lml_")
36 (defun std-footer (file)
38 ((:div :class "disclaimsec")
39 (let ((src-file (make-pathname
40 :defaults *sources-dir*
42 :name (pathname-name file))))
43 (when (probe-file src-file)
45 ((:div :class "lastmod")
46 (lml-format "Last modified: ~A" (date-string (file-write-date src-file)))))))
47 (lml-load "footer.lml_"))))
50 (defmacro std-body (file &body body)
53 (lml-load "banner.lml_")
54 ((:table :class "stdbodytable" :border "0" :cellpadding "3")
57 ((:td :class "stdcontentcell")
58 (lml-load "contents.lml_"))
61 (std-footer ,file))))))))
64 (defmacro print-std-page (file title format &body body)
66 (dtd-prologue ,format)
68 ((:html :xmlns "http://www.w3.org/1999/xhtml")
70 (std-body ,file ,@body)))))
72 (defmacro std-page ((out-file title &key (format :xhtml11))
75 (with-open-file (*html-stream* (lml-file-name ,out-file :output)
77 :if-exists :supersede)
78 (print-std-page (lml-file-name ,out-file :source) ,title ,format ,@body))))
80 (defmacro titled-pre-section (title &body body)
84 ((:pre "style" "padding-left:30pt;")