Skip to content

Commit

Permalink
renamed to hyperscript
Browse files Browse the repository at this point in the history
  • Loading branch information
sliemeobn committed Dec 16, 2024
1 parent e5fdf14 commit f748991
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ let package = Package(
name: "ElementaryHyperscript",
dependencies: [
.product(name: "Elementary", package: "elementary"),
.target(name: "ElementaryHTMX"),
],
swiftSettings: featureFlags
),
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import Elementary
import ElementaryHyperscript

// Hyperscript extension
button(.hs("on click send hello to <form />")) {
button(.hyperscript("on click send hello to <form />")) {
"Send"
}
```
Expand All @@ -69,7 +69,7 @@ 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`.
The package also supports the [Hyperscript](https://hyperscript.org) `_` attribute as `.hyperscript`.

## Future directions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Elementary

public extension HTMLAttribute where Tag: HTMLTrait.Attributes.Global {
static func hs(_ script: String) -> HTMLAttribute {
static func hyperscript(_ script: String) -> Self {
.init(name: "_", value: script)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ import XCTest

final class elementary_hyperscriptTests: XCTestCase {
func testScript() {
HTMLAttributeAssertEqual(.hs("on click send hello to <form />"), "_", "on click send hello to <form />")
HTMLAttributeAssertEqual(.hyperscript("on click send hello to <form />"), "_", "on click send hello to <form />")
}
}

0 comments on commit f748991

Please sign in to comment.