From b712dba9223fbfe0d192a65b243dfe983cebfad4 Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 7 Nov 2024 06:37:03 -0800 Subject: dropped doctype, emitting doctype during rendering typo --- src/hypnotisml.lisp | 25 +++++++++++++++---------- 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 "") - -(defun (&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 element") + +(defun (&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 "" stream)) +(defmethod html ((html-elem html-elem) stream) + (write-string "" 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 @@ #: #:
#:
- #: #:
#: #: -- cgit v1.2.3