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 Objecttrait Matchableclass Any
- Self type
-
TwirlSource.type
Members list
In this article