Templates

Template helps us create blueprints that we can use to generate code.

What are templates?

Templates are what drives derived and is the core of our application. Templates helps us create blueprints that we can use to generate code of the same type.

To create a template, you first have to create a template group

Creating a Template

To Access the template section, click on the Templates tab in the left sidebar. This will open a page where you can see all the templates that are available in the application.

Going to the template section, you will prompted with an page with four columns. The screenshot below shows the template section. The columns represent: file explorer (added/modified files), template code, preview of resolved code, and data sources. Templates

Before creating a template we first select a project. This will be the project that the template will be created in. You can select a project by clicking on the Select Project button. Select your project from the dropdown. This will show you a list of template groups that you have configured before and the templates that are available in the template group.

You can create a new template by clicking on the Add New Template button. This will open a modal. The first dropdown has two option where you can either create a new template or modify an existing code to create a new template.

  • When adding a new template you just have to pass the path to the template file and the template name. The template name can be static or we can also use the templating syntax (make this a hyperlink to the templating syntax section). You will probably prefer the name be dynamic instead of static as you can generate the files with names according to the data source passed to the template.

  • When modifiying an existing code to create a new template, you will have to add an identifier which the template will use to identify the code that is being modified. The identifier can be any string but it is recommended to use a unique string that is not already used in the code.

On this page