TwirlSource

io.github.frikit.twirlspec.html.TwirlSource
object TwirlSource

A Twirl template with the Scala taken out, so that what is left is the HTML it writes.

Scanning a template rather than a rendered page is cheap — no application, no injector, no render — but the source is two languages at once, and one of them uses the angle brackets the other reserves for tags. @if(page < total) is a comparison, not the start of an element, and a scanner that cannot tell the difference reports every paginated page in a large codebase.

Everything belonging to an @ expression is blanked to spaces, keeping newlines so line numbers still point at the template. The { … } block that follows a construct like @if or @formHelper is left alone, because that part is HTML.

Attributes

Source
TwirlSource.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def htmlOnly(template: String): String

The template with every Scala expression blanked to spaces, newlines kept, so line numbers still point at the source.

The template with every Scala expression blanked to spaces, newlines kept, so line numbers still point at the source.

Attributes

Source
TwirlSource.scala