Sbt intellij twirl templates

I'm not sure how to make twirl templates work with Intellij IDEA 14

My build.sbt:

libraryDependencies += "com.typesafe.play" % "twirl-api_2.11" % "1.1.1"

My text template:

@(date: java.util.Date)
hello world

My call for rendering:

  println(play.twirl.api.Txt.testTemplate.render(new Date()))

Compiler Error:

Error:(26, 34) value testTemplate is not a member of object play.twirl.api.Txt
  println(play.twirl.api.Txt.testTemplate.render(new Date()))
                             ^

I read somewhere that I have to compile a template outside of Intellij using:

sbt compile

I'm not sure if this will work. Also, I have a plugin for sbt, but I don’t know how to get the command line version configured on Mac.

Any tips for me?

+4
source share

Source: https://habr.com/ru/post/1613390/


All Articles