-
-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Problem
Cask has no built-in HTML templating. Users must manually construct HTML responses or integrate third-party template engines.
// Current - manual HTML strings (bad)
@cask.get("/")
def index() = {
"""
<html>
<body>
<h1>Welcome</h1>
</body>
</html>
"""
}
// Or raw Scalatags (works, but no defaults)
@cask.get("/")
def index() = {
import scalatags.Text.all._
html(
body(
h1("Welcome")
)
).render
}- No default HTML templating approach
- No type-safe HTML rendering pattern
- No visibility: examples & scalatags in ecosystem
Solution
simple Scalatags integration as the default HTML templating approach
- import for Scalatags in cask
- return Scalatags as HTML response
- Common patterns HMTL layouts
Questions -
- HTML mixed with Scala code - please advice something on separation
- CSS/JS integration - another probelm / concern
- Package
cask.scalatagsorcask.html? - Error pages for 404/500?
References
- Scalatags - type-safe HTML generation
Metadata
Metadata
Assignees
Labels
No labels