parent
4ff1c97e3f
commit
b947bd0836
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:
|
Is internally transformed (by macro expansion) into:
|
||||||
|
|
||||||
```lisp
|
```lisp
|
||||||
(create-element :article '(:class "container")
|
(create-element :article
|
||||||
(list
|
(list :class "container")
|
||||||
(create-element :h1 nil (list "Title"))
|
(list (create-element :h1
|
||||||
(create-element :p nil (list "Paragraph"))
|
(list)
|
||||||
(create-element #'~share-button '(:service :x) (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.
|
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