diff --git a/src/element.lisp b/src/element.lisp index 45b2861..ee6cf5d 100644 --- a/src/element.lisp +++ b/src/element.lisp @@ -72,6 +72,9 @@ ;;;; methods +(defgeneric render-to-string (element &key pretty) + (:documentation "Render an HSX element to a string.")) + (defmethod render-to-string ((element element) &key pretty) (with-output-to-string (stream) (write element :stream stream :pretty pretty))) diff --git a/src/hsx.lisp b/src/hsx.lisp index a3e3d85..053b1ed 100644 --- a/src/hsx.lisp +++ b/src/hsx.lisp @@ -13,6 +13,7 @@ ;;;; hsx macro (defmacro hsx (form) + "Detect built-in HSX elements and automatically import them." (find-builtin-symbols form)) (defun find-builtin-symbols (node) @@ -58,6 +59,9 @@ (defhsx ,name ,(make-keyword name)))) (defmacro defcomp (name props &body body) + "Define a function component for use in HSX. +The props must be declared with either &key or &rest (or both). +The body must return an HSX element." (unless (or (null props) (member '&key props) (member '&rest props))