diff options
author | colin <colin@cicadas.surf> | 2024-11-07 06:37:03 -0800 |
---|---|---|
committer | colin <colin@cicadas.surf> | 2024-11-07 06:38:58 -0800 |
commit | b712dba9223fbfe0d192a65b243dfe983cebfad4 (patch) | |
tree | 2e1fdcc3cbaeb7734ffed4d47e91bd706e4fd6da | |
parent | 3f3bd3392be3768c1d65d5a5edfd0f42178f851b (diff) |
dropped doctype, emitting doctype during <html> rendering
typo
-rw-r--r-- | src/hypnotisml.lisp | 25 | ||||
-rw-r--r-- | src/package.lisp | 1 |
2 files changed, 15 insertions, 11 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 diff --git a/src/package.lisp b/src/package.lisp index 648788a..d2731e6 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -43,7 +43,6 @@ #:<dialog> #:<div> #:<dl> - #:<!doctype> #:<dt> #:<em> #:<embed> |