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.


CodeGeneratorThe primary interface for code generation using a template. An instance can be obtained by importing the exported "Generator" constant into the template.
CodeGenerationOptionsDefines the options for generating a code file with the CodeGenerator.
CodeModelOptionsDefines the options for retrieving a model to be used as input for code generation.
ModelBasedCodeGenerationOptionsCombines the CodeGenerationOptions and CodeModelOptions for the generateFromModel function.
RegionMarkerFormatterRepresents 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.



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