Indexed by TopGit from live GitHub metadata: playframework/twirl has 561 stars, written primarily in Scala. Twirl is Play's default template engine
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Replacing the LATEST_VERSION with the latest version published, which should be . And enable the plugin on projects using:
someProject.enablePlugins(SbtTwirl)
If you only have a single project and are using a build.sbt file, create a
root project and enable the twirl plugin like this:
lazy val root = (project in file(".")).enablePlugins(SbtTwirl)
Template files
Twirl template files are expected to be placed under src/main/twirl or
src/test/twirl, similar to scala or java sources. The source locations for
template files can be configured.
Template files must be named {name}.scala.{ext} where ext can be html,
js, xml, or txt.
The Twirl template compiler is automatically added as a source generator for
both the main/compile and test configurations. When you run compile or
Test/compile the Twirl compiler will generate Scala source files from the
templates and then these Scala sources will be compiled along with the rest of
your project.
Additional imports
To add additional imports for the Scala code in template files, use the
templateImports key. For example:
TwirlKeys.templateImports += "org.example._"
Source directories
To configure the source directories where template files will be found, use the
compileTemplates / sourceDirectories key. For example, to have template
sources alongside Scala or Java source files:
Replacing the TWIRL_VERSION with the latest version published, which should be .
Template files
Twirl template files are expected to be placed under src/main/twirl or
src/test/twirl, similar to scala or java sources. The additional source
locations for template files can be configured.
Template files must be named {name}.scala.{ext} where ext can be html,
js, xml, or txt.
Additional imports
To add additional imports for the Scala code in template files, use the
templateImports parameter. For example:
Replacing the LATEST_VERSION with the latest version published, which should be .
Template files
Twirl template files are expected to be placed under src/main/twirl or
src/test/twirl, similar to scala or java sources. The additional source
locations for template files can be configured.
⚠️Please note that the output of the template compilation is Scala source code.
If you use these templates in your Java source files, you must place them in a joint compilation folder (see the Gradle Scala Plugin documentation for details).
The default location for this folder is src/main/scala, but it can be customized.
Template files must be named {name}.scala.{ext} where ext can be html,
js, xml, or txt.
Additional imports
To add additional imports for the Scala code in template files, use the
templateImports key. For example:
sourceSets {
main {
twirl {
templateImports.add("org.example._")
}
}
}
Source directories
To configure the source directories where template files will be found, use the
srcDir method for SourceDirectorySet. For example:
sourceSets {
main {
twirl {
srcDir("app")
}
}
}
Scala version
To configure the Scala version use the scalaVersion property of TwirlExtension (2.13 by default). For example:
twirl {
scalaVersion.set("3")
}
Other properties
Also, you can use the next properties:
sourceSets {
main {
twirl {
// Annotations added to constructors in injectable templates
constructorAnnotations.add("@org.example.MyAnnotation()")
// Defined custom twirl template formats
templateFormats.put("csv", "play.twirl.api.TxtFormat")
// Source encoding for template files and generated scala files
sourceEncoding.set("<enc>")
}
}
}
Snapshots
To use a snapshot version add the Maven Central Snapshot repository into settings.gradle.kts:
The most recent commit recorded on playframework/twirl was 2 days ago, based on the GitHub push timestamp. The repository has 118 forks — one of the better signals of community interest.
How many stars does playframework/twirl have?
playframework/twirl has 561 GitHub stars — refresh the page for the live number, or check github.com/playframework/twirl. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is playframework/twirl open source?
Yes — playframework/twirl ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/playframework/twirl.
What is playframework/twirl?
playframework/twirl (playframework/twirl) is a Scala project on GitHub. From the project's own README: Twirl is Play's default template engine
What language is playframework/twirl written in?
playframework/twirl is written primarily in Scala. GitHub's language field is based on the largest share of bytes in the default branch.
What license does playframework/twirl use?
playframework/twirl is released under the Apache-2.0 license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about playframework/twirl?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/playframework/twirl is the definitive source.
Read full README in the tab above.
Curious whether twirl is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about twirl.