work in progress: demo app; web/dom: + void-element
This commit is contained in:
parent
473616860f
commit
1ec80a559f
2 changed files with 10 additions and 1 deletions
|
@ -16,3 +16,4 @@
|
||||||
(() server:fileserver :doc-root
|
(() server:fileserver :doc-root
|
||||||
,(util:absolute-dir (config:from-env :docroot "/var/www/html")))))
|
,(util:absolute-dir (config:from-env :docroot "/var/www/html")))))
|
||||||
;,(config:directory "/var/www/html" :env :docroot)
|
;,(config:directory "/var/www/html" :env :docroot)
|
||||||
|
(config:add-action '(:test :data) #'core:echo)
|
||||||
|
|
10
web/dom.lisp
10
web/dom.lisp
|
@ -4,7 +4,7 @@
|
||||||
(:use :common-lisp)
|
(:use :common-lisp)
|
||||||
(:local-nicknames (:util :scopes/util)
|
(:local-nicknames (:util :scopes/util)
|
||||||
(:alx :alexandria))
|
(:alx :alexandria))
|
||||||
(:export #:elem #:element #:render
|
(:export #:elem #:element #:void-element #:render
|
||||||
#:dlist))
|
#:dlist))
|
||||||
|
|
||||||
(in-package :scopes/web/dom)
|
(in-package :scopes/web/dom)
|
||||||
|
@ -38,6 +38,14 @@
|
||||||
(put c))
|
(put c))
|
||||||
(end tag))))
|
(end tag))))
|
||||||
|
|
||||||
|
(defclass void-element (element) ())
|
||||||
|
|
||||||
|
(defun void-element (tag attrs)
|
||||||
|
(make-instance 'void-element :tag tag :attrs attrs))
|
||||||
|
|
||||||
|
(defmethod put ((el void-element))
|
||||||
|
(start (tag el) (attrs el)))
|
||||||
|
|
||||||
;;;; elements with specific functionality
|
;;;; elements with specific functionality
|
||||||
|
|
||||||
(defun dlist (attrs plist)
|
(defun dlist (attrs plist)
|
||||||
|
|
Loading…
Add table
Reference in a new issue