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
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:
25 ;;; These files are optional
31 (defmacro std-head (title &body body)
34 (:title (:princ ,title))
35 (lml-load "header.lml_")
39 (defun std-footer (file)
41 ((:div :class "disclaimsec")
42 (let ((src-file (make-pathname
43 :defaults *sources-dir*
45 :name (pathname-name file))))
46 (when (probe-file src-file)
48 ((:div :class "lastmod")
49 (lml-format "Last modified: ~A" (date-string (file-write-date src-file)))))))
50 (lml-load "footer.lml_"))))
53 (defmacro std-body (file &body body)
56 (lml-load "banner.lml_")
57 ((:table :class "stdbodytable" :border "0" :cellpadding "3")
60 ((:td :class "stdcontentcell")
61 (lml-load "contents.lml_"))
66 (lml-load "rightcol.lml_" :optional t)))))
67 (lml-load "final.lml_" :optional t))))
70 (defmacro print-std-page (file title format encoding &body body)
72 (dtd-prologue ,format ,encoding)
74 ((:html :xmlns "http://www.w3.org/1999/xhtml")
76 (std-body ,file ,@body)))))
78 (defmacro std-page ((out-file title &key (format :xhtml10-strict) (encoding :utf-8))
81 (with-open-file (*html-stream* (lml-file-name ',out-file :output)
83 :if-exists :supersede)
84 (print-std-page (lml-file-name ',out-file :source) ,title ,format ,encoding ,@body))))
86 (defmacro titled-pre-section (title &body body)
90 ((:pre "style" "padding-left:30pt;")