-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Static Functions #39
Conversation
let doc: Node = .document( | ||
.html( | ||
.head( | ||
.style(safe: stylesheet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One weird concession was without making safe
vs. unsafe
explicit, I'd get ambiguous errors that required as StaticString
even on string literals. Was strange and maybe worth filing a bug for!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh dang strange
img(base64: "ZnVuY3Rpb25z", type: .image(.svg), alt: "", [Html.class("hide-d")]) | ||
.body( | ||
.header( | ||
attributes: [.class("bg-purple150 d-pt4 d-pb4 m-pl2 m-pr2 m-pt2 m-pb2")], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.class
is feelin nicer than Html.class
or backticks!
@@ -1,136 +1,79 @@ | |||
<a> | |||
foo1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are all the deletions in this file intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so but will audit. We were testing each overload before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
niiiice
Gonna merge for now! Can make future adjustments before any official release. |
Here's a preliminary PR for what we talked about!
Right now I use
attributes: […]
consistently everywhere, but functions with no content could use_ attributes: Attribute...
instead.We could also add overloads to accept
.async
wherever booleans like.async(true)
work.