Skip to content

Custom templates

The template generator can load templates from a custom directory and/or custom template paths.

Use a custom template directory

Provide customTemplateDir in generatorOptions:

generator: "template"
generatorOptions:
  templateSet: "custom"
  customTemplateDir: "./templates"
  classTemplatePath: "class.mustache"

Notes

  • The generator still passes templateVariables to templates as customVariables.*.
  • Built-in templates expect class.mustache and method.mustache partials; custom templates can choose their own structure. (Use classTemplatePath to point at the class template and include partials from there.)