Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

Table of Contents
maxLevel3

Prerequisites

It is assumed the VSCode Plugin and uip-cli version 2.0.0 are installed.

The development environment will be WSL (Windows Subsystem for Linux), however, it could be any of the supported platforms. The tutorial assumes a folder called demo_template has been opened in VSCode.

Introduction

The custom, starter template that we will create is a contrived example, but it sufficiently covers all the features and its usefulness.

Step 1 - Create the Initial Template

To create a custom starter template, we will first make use of the built-in ue-task template. Open up the terminal to the demo_template folder and run

...

Code Block
demo_template/
├── .uip
│   └── config
│       └── uip.yml
├── __init__.py
├── requirements.txt
├── setup.cfg
├── setup.py
├── src
│   ├── __init__.py
│   ├── extension.py
│   ├── extension.yml
│   └── templates
│       └── template.json
└── template_config.yml

Step 2 - Configuring the Initial Template

To make the template configurable, add the following content below to template_config.yml:

...

On line 86 of the snippet above, the value of logLevel was changed from Inherited to {{ log_level | title }}. Once again, this is Jinja2 syntax that will eventually be replaced with the specified value of log_level (or the default, if nothing is specified). Additionally, the built-intitle filter is applied to the value of log_level. This will ensure values like trACe end up as Trace (first letter capitalized and everything else lowercase) as required by template.json.

Step 3 - Packaging the Initial Template

Although the example is a bit contrived, we have managed to create a fully-functional customized template.

...