diff --git a/src/utils/list.lisp b/src/utils/list.lisp index 3bc3cc4c..fcfc4d47 100644 --- a/src/utils/list.lisp +++ b/src/utils/list.lisp @@ -16,9 +16,7 @@ #:ninsert #:find-all #:remove-keyword-parameter - #:remove-keyword-parameters - #:safe-first - #:safe-rest)) + #:remove-keyword-parameters)) (in-package #:reblocks/utils/list) @@ -31,26 +29,6 @@ (setf end length)) (subseq sequence start end))) -(defun safe-first (item) - "Returns first element of ITEM. -There are two cases: -- ITEM is a list, in which case it returns (first ITEM) -- ITEM is not a list, in which case it retuns ITEM. -The effect is the same as (first (alexandria:ensure-list item))" - (typecase item - (list (first item)) - (t item))) - -(defun safe-rest (item) - "Returns rest of ITEM -There are two cases: -- ITEM is a list, in which case it returns (rest ITEM) -- ITEM is not a list, in whch case it returns nil. -The effect is the same as (rest (alexandria:ensure-list item))" - (typecase item - (list (rest item)) - (t nil))) - ;; TODO: replace with alexandria:alist-plist (defun alist->plist (alist) "Converts an alist to plist." diff --git a/src/widget.lisp b/src/widget.lisp index 184556a7..9636dba8 100644 --- a/src/widget.lisp +++ b/src/widget.lisp @@ -73,26 +73,29 @@ inherits from REBLOCKS/WIDGET:WIDGET if no DIRECT-SUPERCLASSES are provided." You can use any other templating engine, just ensure it writes output to REBLOCKS/HTML:*STREAM* - Outer DIV wrapper will be added automaticall. It will - have CSS tags returned by GET-CSS-CLASSES.")) + Outer DIV wrapper will be added automaticall, see GET-HTML-TAG. + It will have CSS tags returned by GET-CSS-CLASSES.")) (defgeneric get-html-tag (widget) (:documentation "This method determines the enclosing tag of the widget. -The return value should either be a keyword like :div, which will be the enclosing tag, -or a list of the form (:tag . attributes), where :tag is the enclosing tag (like :div) -and attributes is a property list, where the keys are keywords, corresponding to the attribute name -and the values are the values of the attribute. + +The return value should either be a keyword like :div, +which will be the enclosing tag, or a list of the form (:tag . attributes), +where :tag is the enclosing tag (like :div) and attributes is a property list. + +The attributes property list has keywords for keys, corresponding to +the attribute name and the values are the values of the attribute. For example: -- :div -- generates a