HTML templating.
HTML templating.
val items: List[Item] = ??? val content: Html = html""" <h1>Items</h1> ${if(items.isEmpty) { html"<em>No results</em>" } else { html""" <ul> ${items.map { item => html"<li>${item.name}</li>" }} </ul> """ }} """
Html values can be easily created from the html interpolation. They will be encoded as Content thanks to Html.encoder.