diff options
Diffstat (limited to 'src/hypnotisml.lisp')
-rw-r--r-- | src/hypnotisml.lisp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/src/hypnotisml.lisp b/src/hypnotisml.lisp index b681f30..5a3ec84 100644 --- a/src/hypnotisml.lisp +++ b/src/hypnotisml.lisp @@ -66,13 +66,6 @@ (parent :type (or null elem)) :documentation "Root class for all dom-nodes") -(def:class doctype-html (node) - :documentation "<!DOCTYPE html>") - -(defun <!doctype> (&rest ignore) - (declare (ignore ignore)) - (make-instance 'doctype-html)) - (defun node-p (x) (typep x 'node)) (defun node-list-p (es) @@ -98,6 +91,18 @@ (children :type node-list) :documentation "The base class for all UI elements.") +(def:class html-elem (elem) + :documentation "the <HTML> element") + +(defun <html> (&rest contents) + (multiple-value-bind (s a c) (parse-contents contents) + (declare (ignore s a)) + (make-instance 'html-elem + :tag :html + :style nil + :attributes nil + :children c))) + (defun ensure-parent (parent nodes) (loop :for node :in nodes :do (setf (parent node) parent))) @@ -320,8 +325,9 @@ already present in the element." (indent stream) (write-string (text-content text) stream)) -(defmethod html ((doctype-html doctype-html) stream) - (write-string "<!DOCTYPE html>" stream)) +(defmethod html ((html-elem html-elem) stream) + (write-string "<!DOCTYPE html>" stream) + (call-next-method)) ;;; ELEM BUILDERS @@ -438,7 +444,6 @@ CONTENTS is a list of NODE instances." header hgroup hr - html i iframe img |