Skip to content

Dynamic Template Variables

Latest
Compare
Choose a tag to compare
@reesemclean reesemclean released this 03 Jan 00:08
· 5 commits to master since this release

This release adds support for additional tokens within your template.

Sometimes when creating a template you may want to use multiple pieces of user input -- this is now possible by using additional tokens prefixed with a $. Here's an example:

// Example Template

class {{ pascalCase name }} extends {{ pascalCase $superclass }} {
  {{ camelCase $propertyName }}: string;
}

When creating a new file from this template you will continue to be asked for the name, but you would have the opportunity to enter information for both $superclass and $propertyName. As of now only name is able to be used within filenames.

Thanks to @dj-doMains for the pull request!.