r5301: *** empty log message ***
[lml2.git] / htmlgen.lisp
index f77b6b6a344d94aef7256c16978cba53d7652d3b..dab8c16d975852736ab82c0100a0114dbbd1bd20 100644 (file)
@@ -1,6 +1,6 @@
 ;; -*- mode: common-lisp; package: lml2 -*-
 ;;
-;; $Id: htmlgen.lisp,v 1.10 2003/06/25 21:24:09 kevin Exp $
+;; $Id: htmlgen.lisp,v 1.12 2003/07/13 04:56:12 kevin Exp $
 ;;
 ;; copyright (c) 1986-2000 Franz Inc, Berkeley, CA 
 ;; copyright (c) 2003 Kevin Rosenberg
@@ -8,7 +8,7 @@
 ;; Main changes from Allegro version:
 ;;    - Support XHTML end tags
 ;;    - lowercase symbol names for attributes
-;;    - Add custom tags such as :jscript, :insert-file, :nbsp
+;;    - Add custom tags such as :jscript, :insert-file, :load-file, :nbsp
 ;;    - removal of if* macro -- partially complete
 ;;
 ;; This code is free software; you can redistribute it and/or
        ;; must use <!--   --> syntax
        (declare (ignore ent args argsp))
        `(progn
-         (write-string "<script language=\"JavasSript\" type=\"text/javascript\">" *html-stream*)
+         (write-string "<script language=\"JavaScript\" type=\"text/javascript\">" *html-stream*)
          (write-char #\newline *html-stream*)
          (write-string "//![CDATA[" *html-stream*)
          (write-char #\newline *html-stream*)
          (write-string "&nbsp;" stream)
        (error ":nbsp in an illegal place: ~s" form)))))
 
+
+(def-special-html :load-file
+    (named-function html-nbsp-function
+      (lambda (ent args argsp body)
+       (declare (ignore ent args argsp))
+       (unless body
+         (error "must have a body with :load-file"))
+       `(progn ,@(mapcar #'(lambda (bod)
+                             `(lml-load ,bod))
+                         body))))
+  
+  (named-function html-nbsp-print-function
+    (lambda (ent cmd args form subst unknown stream)
+      (declare (ignore ent unknown subst stream args))
+      (assert (eql 2 (length form)))
+      (if (eq cmd :full)
+         (lml-load (cadr form))
+       (error ":load-file must be given an argument")))))
+
 (def-special-html :insert-file
     (named-function html-nbsp-function
       (lambda (ent args argsp body)
        (unless body
          (error "must have a body with :insert-file"))
        `(progn ,@(mapcar #'(lambda (bod)
-                             `(lml-load-path ,bod))
+                             `(insert-file ,bod))
                          body))))
   
   (named-function html-nbsp-print-function
       (declare (ignore ent unknown subst stream args))
       (assert (eql 2 (length form)))
       (if (eq cmd :full)
-         (lml-load-path (cadr form))
-         (error ":insert-file must be given an argument")))))
-
+         (insert-file (cadr form))
+       (error ":insert-file must be given an argument")))))
 
 (def-special-html :write-string
     (named-function html-write-string-function