-
-
Notifications
You must be signed in to change notification settings - Fork 470
Documentation of Template2 #3839
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for zio-http ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@jdegoes This is ready for your review! |
987Nabil
left a comment
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.
For template2 as well as twirl an example with the endpoint API would be nice. template2 has an HttpContentCodec. That one could also be used by twirl. Like call transform and transform a twirl Html or String to a Dom
| div(`class` := "user-card")( | ||
| h3(user.name), | ||
| if (showEmail) p(user.email) else Dom.empty, | ||
| user.avatar.map(url => img(src := url)) |
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.
You should make explicit in text that this is option of Dom
| If we need to create a custom element that is not predefined, we can use the `Dom.element` method: | ||
|
|
||
| ```scala mdoc:compile-only | ||
| Dom.element("custom-tag")(custom("x-property") := "value")("Content here") |
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'd prefer Dom.attr over custom. I think it is more explicit
| //</style> | ||
| ``` | ||
|
|
||
| To inline a CSS file from the resource directory, use `inlineResource`: |
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.
This also exists for script
also resolved #3157