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 LML, is Copyright (c) 2002 by Kevin M. Rosenberg
14 ;;;; LML 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 LML package.
21 ;;; A stdsite page expects to include the following files:
29 (defmacro std-head (title &body body)
32 (lml-load "head.lml_")
36 (defun std-footer (file)
38 (let ((src-file (make-pathname
39 :defaults *sources-dir*
41 :name (pathname-name file))))
42 (when (probe-file src-file)
44 (lml-format "Last modified: ~A" (date-string (file-write-date src-file))))))
45 (lml-load "footer.lml_"))
49 (defmacro std-body (file &body body)
51 (lml-load "banner.lml_")
52 (table-c "stdbodytable" :border "0" :cellpadding "3"
55 (td-c "stdcontentcell"
56 (lml-load "contents.lml_"))
59 (std-footer ,file)))))
60 (lml-load "final.lml_")))
63 (defmacro print-std-page (file title &body body)
66 (html :xmlns "http://www.w3.org/1999/xhtml"
68 (std-body ,file ,@body))))
70 (defmacro std-page (out-file title &body body)
72 (with-open-file (*html-output* (lml-file-name ',out-file :output)
74 :if-exists :supersede)
75 (print-std-page (lml-file-name ',out-file :source) ,title ,@body))))
77 (defmacro titled-pre-section (title &body body)
80 (pre :style "padding-left:30pt;"