From e5fdf143901aaf90e861bfc5f5319657ec11eaa9 Mon Sep 17 00:00:00 2001 From: Maciej Trybilo Date: Fri, 8 Nov 2024 15:58:31 +0100 Subject: [PATCH] Update Readme. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 1b22df1..f703519 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,16 @@ div(.hx.ext(.ws), .ws.connect("/echo")) { } ``` +```swift +import Elementary +import ElementaryHyperscript + +// Hyperscript extension +button(.hs("on click send hello to
")) { + "Send" +} +``` + ## Play with it Check out the [Hummingbird example app](https://github.com/sliemeobn/elementary-htmx/tree/main/Examples/HummingbirdDemo). @@ -59,6 +69,8 @@ The package brings the `.hx` syntaxt to all `HTMLElements` - providing a rich AP There is also an `ElementaryHTMXSSE` module that adds the `.sse` syntax for the [Server Sent Events extensions](https://github.com/bigskysoftware/htmx-extensions/blob/main/src/sse/README.md), as well as `ElementaryHTMXWS` to add the `.ws` syntax for the [WebSockets extensions.](https://github.com/bigskysoftware/htmx-extensions/blob/main/src/ws/README.md) +The package also supports the [Hyperscript](https://hyperscript.org) `_` attribute as `.hs`. + ## Future directions - Add module (or separate package?) for HTMX Request and Response headers