1 ;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
6 ;;;; Purpose: Lisp Markup Language functions
7 ;;;; Programmer: Kevin M. Rosenberg
8 ;;;; Date Started: Aug 2002
10 ;;;; $Id: base.lisp,v 1.2 2003/06/20 04:46:54 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 ;;;; *************************************************************************
22 (defun reset-indent ()
25 (defun lml-format (str &rest args)
26 (when (streamp *html-stream*)
27 (when *print-spaces* (indent-spaces *indent* *html-stream*))
29 (apply #'format *html-stream* str args)
30 (write-string str *html-stream*))
31 (when *print-spaces* (write-char #\newline *html-stream*))))
34 (princ s *html-stream*))
37 (format *html-stream* "~A~%" s))
39 (defun lml-write-char (char)
40 (write-char char *html-stream*))
42 (defun lml-write-string (str)
43 (write-string str *html-stream*))
45 (defun lml-print-date (date)
46 (lml-write-string (date-string date)))
48 (defmacro xhtml-prologue ()
50 (lml-write-string (xml-prologue-string))
51 (lml-write-char #\newline)
52 (lml-write-string (xhtml-prologue-string))
53 (lml-write-char #\newline)))
55 (defmacro print-page (title &body body)
58 (:title (:princ ,title)))
61 (defmacro page (out-file &body body)
62 `(with-open-file (*html-stream*
63 (lml-file-name ,out-file :output)
65 :if-exists :supersede)
68 ((:html :xmlns "http://www.w3.org/1999/xhtml")
73 (defmacro alink (url desc)
75 ((:a :href ,url) ,desc)))
77 (defmacro alink-c (class url desc)
79 ((:a :class ,class :href ,url) ,desc)))
81 (export '(alink alink-c))