1 ;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
6 ;;;; Purpose: Functions to create my standard style sites
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Aug 2002
10 ;;;; $Id: stdsite.cl,v 1.1 2002/09/16 01:13:49 kevin Exp $
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:
27 (declaim (optimize (debug 3) (speed 3) (safety 1) (compilation-speed 0)))
30 (defmacro std-head (title &body body)
33 (lml-load #p"head.lml_")
37 (defun std-footer (file)
39 (let ((ds (date-string
40 (file-write-date (make-pathname
41 :defaults *sources-dir*
43 :name (pathname-name file))))))
46 (lml-print "Last modified: ~A" ds)))))
47 (lml-load #p"footer.lml_")
51 (defmacro std-body (file &body body)
53 (lml-load #p"banner.lml_")
54 (table-c "stdbodytable" :border "0" :cellpadding "3"
57 (td-c "stdcontentcell"
58 (lml-load #p"contents.lml_"))
61 (std-footer ,file)))))))
64 (defmacro print-std-page (file title &body body)
67 (html :xmlns "http://www.w3.org/1999/xhtml"
69 (std-body ,file ,@body))))
71 (defmacro std-page (out-file title &body body)
73 (with-open-file (*html-output* (lml-file-name ,out-file :output)
75 :if-exists :supersede)
76 (print-std-page (lml-file-name ,out-file :source) ,title ,@body))))
78 (defmacro titled-pre-section (title &body body)
81 (pre :style "padding-left:30pt;"