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.4 2003/06/23 20:37:43 kevin Exp $
12 ;;;; This file, part of LML2, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; LML2 users are granted the rights to distribute and use this software
15 ;;;; as governed by the terms of the GNU General Public License v2
16 ;;;; (http://www.gnu.org/licenses/gpl.html)
17 ;;;; *************************************************************************
19 ;;; A "standard site" is a format for a certain style of web page.
20 ;;; It is based on the LML2 package.
21 ;;; A stdsite page expects to include the following files:
29 (defmacro std-head (title &body body)
32 (:title (:princ ,title))
33 (lml-load "head.lml_")
37 (defun std-footer (file)
39 ((:div :class "disclaimsec")
40 (let ((src-file (make-pathname
41 :defaults *sources-dir*
43 :name (pathname-name file))))
44 (when (probe-file src-file)
46 ((:div :class "lastmod")
47 (lml-format "Last modified: ~A" (date-string (file-write-date src-file)))))))
48 (lml-load "footer.lml_"))))
51 (defmacro std-body (file &body body)
54 (lml-load "banner.lml_")
55 ((:table :class "stdbodytable" :border "0" :cellpadding "3")
58 ((:td :class "stdcontentcell")
59 (lml-load "contents.lml_"))
62 (std-footer ,file))))))))
65 (defmacro print-std-page (file title format &body body)
67 (html-prologue ,format)
69 ((:html :xmlns "http://www.w3.org/1999/xhtml")
71 (std-body ,file ,@body)))))
73 (defmacro std-page ((out-file title &key (format :xhtml11))
76 (with-open-file (*html-stream* (lml-file-name ,out-file :output)
78 :if-exists :supersede)
79 (print-std-page (lml-file-name ,out-file :source) ,title ,format ,@body))))
81 (defmacro titled-pre-section (title &body body)
85 ((:pre "style" "padding-left:30pt;")