Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 2.29 KB

twirl.md

File metadata and controls

31 lines (19 loc) · 2.29 KB

twirl_templates

load("@//twirl:twirl.bzl", "twirl_templates")

twirl_templates(name, srcs, additional_imports, include_play_imports, source_directory,
                template_formats, twirl_toolchain_name)

Compiles Twirl templates to Scala sources files.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
srcs The actual template files contained in the source_directory. List of labels required
additional_imports Additional imports to import to the Twirl templates. List of strings optional []
include_play_imports If true, include the imports the Play project includes by default. Boolean optional False
source_directory Directories where Twirl template files are located. Label required
template_formats Formatter types for file extensions.

The default formats are
"html" -> "play.twirl.api.HtmlFormat",
"txt" -> "play.twirl.api.TxtFormat",
"xml" -> "play.twirl.api.XmlFormat",
"js" -> "play.twirl.api.JavaScriptFormat"
Dictionary: String -> String optional {}
twirl_toolchain_name The name of the Twirl toolchain to use for this target String optional ""