forked from gigamonkey/monkeylib-foo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhtml-legacy.lisp
29 lines (23 loc) · 1.09 KB
/
html-legacy.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
;;
;; Copyright (c) 2005-2007, Gigamonkeys Consulting All rights reserved.
;;
(in-package :foo.xml)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Public API
(defmacro with-html-output ((stream &key (pretty *pretty*)) &body body)
"DEPRECATED: used WITH-FOO-OUTPUT"
`(with-foo-output (,stream :pretty ,pretty) ,@body))
(defmacro with-html-to-file ((file &key (pretty *pretty*)) &body body)
(with-unique-names (stream)
`(with-open-file (,stream ,file :direction :output :if-exists :supersede)
(with-foo-output (,stream :pretty ,pretty)
,@body))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Special Forms
;; This can be used to embed, say, CSS in the HTML page.
(define-html-special-operator :with-language (language processor (new-language) &body body)
(declare (ignore language))
(let ((new-language (if (boundp new-language)
(symbol-value new-language)
new-language)))
(loop for exp in body do (process new-language processor exp (top-level-environment new-language)))))