Templating API reference


When creating a Yellicode template, you will always need to import this API, which can be found in the the @yellicode/templating NPM package. It contains the basic templating infrastructure, as well as utilities and base classes for creating custom code writers and model transforms.


CodeGenerator The primary interface for code generation using a template. An instance can be obtained by importing the exported "Generator" constant into the template.
CodeGenerationOptions Defines the options for generating a code file with the CodeGenerator.
CodeModelOptions Defines the options for retrieving a model to be used as input for code generation.
ModelBasedCodeGenerationOptions Combines the CodeGenerationOptions and CodeModelOptions for the generateFromModel function.
RegionMarkerFormatter Represents a class that formats file region names into a start- and end marker string. These markers are used to embed parts of other files (regions) in the generated code.



OutputMode Specifies (from inside a template) how to deal with generating files that already exist.