summaryrefslogtreecommitdiff
path: root/src/hypnotisml.lisp
diff options
context:
space:
mode:
authorcolin <colin@cicadas.surf>2024-11-07 06:37:03 -0800
committercolin <colin@cicadas.surf>2024-11-07 06:38:58 -0800
commitb712dba9223fbfe0d192a65b243dfe983cebfad4 (patch)
tree2e1fdcc3cbaeb7734ffed4d47e91bd706e4fd6da /src/hypnotisml.lisp
parent3f3bd3392be3768c1d65d5a5edfd0f42178f851b (diff)
dropped doctype, emitting doctype during <html> rendering
typo
Diffstat (limited to 'src/hypnotisml.lisp')
-rw-r--r--src/hypnotisml.lisp25
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