Handlebars Helpers
ADL templates are written in Handlebars. On top of the standard Handlebars syntax, ADL registers a set of helper functions that make working with metadata easier — comparing strings, looking up extension properties, generating predictable test data, and so on.
These helpers can be used inside any template. For the concepts, see Templates & Code Generation.
Available helpers
Section titled “Available helpers”Lookups
Section titled “Lookups”extension_exists— check whether a named extension property exists on a Data Object.extension_lookupextension— read the value of an extension property.extension_targetdataitemexists— check whether a Data Item exists on the target Data Object.
Strings
Section titled “Strings”extension_stringcompare— compare two strings.extension_stringdiff— diff two strings.extension_stringreplace— replace substrings.extension_stringwrap— wrap a string with given prefix and suffix.extension_replicate— repeat a string N times.extension_space— emit N spaces (useful for indentation).
Dates & test data
Section titled “Dates & test data”extension_now— current timestamp.extension_randomdate— random date within a range.extension_randomnumber— random number within a range.extension_randomstring— random string.
Where these come from
Section titled “Where these come from”The helpers are registered by ADL’s generation engine. The full implementation lives in the HandlebarsHelpers class in the open-source generation library.