Wrap html element function with macro
This commit is contained in:
parent
3d8fad8e3f
commit
3815dd36b5
1 changed files with 5 additions and 1 deletions
|
@ -75,12 +75,16 @@ When given :ASCII and :ATTR, it's possible to insert html text as a children, e.
|
||||||
|
|
||||||
(defvar *builtin-elements* (make-hash-table))
|
(defvar *builtin-elements* (make-hash-table))
|
||||||
|
|
||||||
(defun html (&rest attrs-and-children)
|
(defun %html (&rest attrs-and-children)
|
||||||
(multiple-value-bind (attrs children)
|
(multiple-value-bind (attrs children)
|
||||||
(split-attrs-and-children attrs-and-children)
|
(split-attrs-and-children attrs-and-children)
|
||||||
(make-builtin-element-with-prefix :tag "html" :attrs attrs
|
(make-builtin-element-with-prefix :tag "html" :attrs attrs
|
||||||
:children children
|
:children children
|
||||||
:prefix "<!DOCTYPE html>")))
|
:prefix "<!DOCTYPE html>")))
|
||||||
|
|
||||||
|
(defmacro html (&body attrs-and-children)
|
||||||
|
`(%html ,@attrs-and-children))
|
||||||
|
|
||||||
(setf (gethash :html *builtin-elements*) t)
|
(setf (gethash :html *builtin-elements*) t)
|
||||||
|
|
||||||
(defmacro define-builtin-element (element-name)
|
(defmacro define-builtin-element (element-name)
|
||||||
|
|
Loading…
Reference in a new issue