This commit is contained in:
paku 2024-05-29 12:57:51 +09:00
parent 9d4d1aa9b6
commit 5a63bf8154
4 changed files with 4 additions and 10 deletions

View file

@ -4,7 +4,6 @@
#:deftag)) #:deftag))
(in-package #:hsx/builtin) (in-package #:hsx/builtin)
(defmacro define-builtin-tags (&rest names) (defmacro define-builtin-tags (&rest names)
`(progn `(progn
,@(mapcan (lambda (name) ,@(mapcan (lambda (name)

View file

@ -9,7 +9,6 @@
#:defcomp)) #:defcomp))
(in-package #:hsx/defhsx) (in-package #:hsx/defhsx)
(defmacro defhsx (name element-type) (defmacro defhsx (name element-type)
`(defmacro ,name (&body body) `(defmacro ,name (&body body)
(multiple-value-bind (props children) (multiple-value-bind (props children)

View file

@ -8,7 +8,6 @@
#:render)) #:render))
(in-package #:hsx/element) (in-package #:hsx/element)
;;;; class definitions ;;;; class definitions
(defclass element () (defclass element ()
@ -30,7 +29,6 @@
(defclass component (element) ()) (defclass component (element) ())
;;;; factory ;;;; factory
(defun create-element (type props &rest children) (defun create-element (type props &rest children)
@ -52,9 +50,12 @@
(rec (cdr x) acc)))))) (rec (cdr x) acc))))))
(rec x nil))) (rec x nil)))
;;;; methods ;;;; methods
(defmethod render ((element element) &key minify)
(with-output-to-string (stream)
(write element :stream stream :pretty (not minify))))
(defmethod print-object ((element tag) stream) (defmethod print-object ((element tag) stream)
(with-accessors ((type element-type) (with-accessors ((type element-type)
(props element-props) (props element-props)
@ -115,7 +116,3 @@
(append props (append props
(and children (and children
(list :children children)))) (list :children children))))
(defmethod render ((element element) &key minify)
(with-output-to-string (stream)
(write element :stream stream :pretty (not minify))))

View file

@ -3,7 +3,6 @@
(:export #:hsx)) (:export #:hsx))
(in-package #:hsx/hsx) (in-package #:hsx/hsx)
(defmacro hsx (&body form) (defmacro hsx (&body form)
(when (not (= (length form) 1)) (when (not (= (length form) 1))
(error "The body of the hsx macro must be a single form.")) (error "The body of the hsx macro must be a single form."))