Format
This commit is contained in:
parent
9d4d1aa9b6
commit
5a63bf8154
4 changed files with 4 additions and 10 deletions
|
@ -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)
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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))))
|
|
||||||
|
|
|
@ -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."))
|
||||||
|
|
Loading…
Reference in a new issue