Skip to content

Templates

The Templates screen is where you create and manage the templates that drive ADL’s code generation. Each template is a Handlebars file that defines what output should be generated for your data objects.

  • Add new templates to your project.
  • Edit templates using the built-in code editor, which provides syntax highlighting for Handlebars.
  • Delete templates you no longer need.
  • Browse all templates in your project.

ADL includes a full-featured code editor for working with templates. You can write Handlebars syntax with the help of syntax highlighting, and see your template content alongside your metadata.

While editing a template, you can quickly check how it renders against your metadata objects using the Code Preview screen.

A template is a text file that mixes static content with Handlebars expressions. When ADL processes the template against a data object, it replaces the expressions with real values from your metadata.

Templates can generate any text-based output — SQL scripts, documentation, configuration files, deployment scripts, and more.

ADL comes with a library of built-in templates for common patterns. You can use them as-is, customize them, or write your own from scratch.

  • Start with the built-in templates — Even if you plan to write custom templates, the built-in ones are a great reference for how to structure your Handlebars code.
  • Use the Code Preview often — It’s the fastest way to check that your template produces the output you expect.
  • Check the Handlebars Helpers — ADL provides custom helper functions that make working with metadata much easier.
  • Keep templates focused — A template that does one thing well is easier to maintain than one that tries to handle every scenario.