parent
314f7cb273
commit
22001ef3e2
4 changed files with 14 additions and 4 deletions
|
@ -171,6 +171,10 @@ Or loop:
|
|||
(hsx (li item))))))
|
||||
```
|
||||
|
||||
## Utils
|
||||
|
||||
- `(clsx &rest strs)`: A utility function for constructing class strings conditionally. It removes `nil` from the string list, then joins the remaining strings with spaces.
|
||||
|
||||
## 📄 License
|
||||
|
||||
MIT License
|
||||
|
|
2
hsx.asd
2
hsx.asd
|
@ -1,5 +1,5 @@
|
|||
(defsystem "hsx"
|
||||
:version "0.5.0"
|
||||
:version "0.6.0"
|
||||
:description "Simple and powerful HTML generation library."
|
||||
:author "Akira Tempaku, Bo Yao"
|
||||
:maintainer "Akira Tempaku <paku@skyizwhite.dev>"
|
||||
|
|
|
@ -2,9 +2,11 @@
|
|||
(:nicknames #:hsx/main)
|
||||
(:use #:cl
|
||||
#:hsx/element
|
||||
#:hsx/dsl)
|
||||
#:hsx/dsl
|
||||
#:hsx/utils)
|
||||
(:import-from #:hsx/builtin)
|
||||
(:export #:hsx
|
||||
#:defcomp
|
||||
#:render-to-string))
|
||||
#:render-to-string
|
||||
#:clsx))
|
||||
(in-package :hsx)
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
#:make-keyword
|
||||
#:symbolicate)
|
||||
(:export #:escape-html-attribute
|
||||
#:escape-html-text-content))
|
||||
#:escape-html-text-content
|
||||
#:clsx))
|
||||
(in-package #:hsx/utils)
|
||||
|
||||
(defparameter *text-content-escape-map*
|
||||
|
@ -40,3 +41,6 @@
|
|||
|
||||
(defun escape-html-attribute (str)
|
||||
(escape-string str *attribute-escape-map*))
|
||||
|
||||
(defun clsx (&rest strs)
|
||||
(format nil "~{~a~^ ~}" (remove nil strs)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue