Customizing Takomo with Typescript allows you to implement your own templating engine or customize Takomo's default Handlebars templating engine with Typescript.
If you want to implement your own template engine from scratch, you need to implement two objects. First, the template engine itself which must implement interface TemplateEngine, and then a provider that implements TemplateEngineProvider and is used to instantiate the template engine.
In your entry point file (defaults to takomo.ts
) you register the template engine provider with templateEngineProvider
property:
Please note that templateEngineProvider
completely overrides any Handlebars configuration you have specified in takomo.yml file.
You can also customize the default Handlebars templating engine like so:
Your helpers must be of type HandlebarsHelper. You can also implement helper providers of type HandlebarsHelperProvider that instantiate helpers.