2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-11-27 05:43:25 +00:00
bazel-skylib/docs/expand_template_doc.md
Alexandre Rostovtsev 99ffbbf8a4
Prepare release 1.6.0 (#496)
And take the opportunity to reformat docs using a more modern Stardoc release
2024-04-24 17:40:06 -04:00

1.5 KiB
Executable file

A rule that performs template expansion.

expand_template

expand_template(name, out, substitutions, template)

Template expansion

This performs a simple search over the template file for the keys in substitutions, and replaces them with the corresponding values.

There is no special syntax for the keys. To avoid conflicts, you would need to explicitly add delimiters to the key strings, for example "{KEY}" or "@KEY@".

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
out The destination of the expanded file. Label required
substitutions A dictionary mapping strings to their substitutions. Dictionary: String -> String required
template The template file to expand. Label required