parent
bd5f4d749d
commit
91206c9ed0
1 changed files with 11 additions and 5 deletions
16
README.md
16
README.md
|
@ -26,11 +26,17 @@ For example:
|
|||
Is internally transformed (by macro expansion) into:
|
||||
|
||||
```lisp
|
||||
(create-element :article '(:class "container")
|
||||
(list
|
||||
(create-element :h1 nil (list "Title"))
|
||||
(create-element :p nil (list "Paragraph"))
|
||||
(create-element #'~share-button '(:service :x) (list))))
|
||||
(create-element :article
|
||||
(list :class "container")
|
||||
(list (create-element :h1
|
||||
(list)
|
||||
(list "Title"))
|
||||
(create-element :p
|
||||
(list)
|
||||
(list "Paragraph"))
|
||||
(create-element #'~share-button
|
||||
(list :service :x)
|
||||
(list))))
|
||||
```
|
||||
|
||||
This is made possible via the hsx macro, which detects HTML tags and components, then rewrites them using create-element. Tags are converted to keywords (e.g., div → :div), and custom components (starting with ~) are passed as functions.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue