Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extension ¶
func Extension(scriptPath string, options ...Option) scaffolder.Extension
Extension is a scaffolder extension that allows the use of end-user-provided JavaScript code to write template functions.
The extension will execute the JS file scriptPath in the source directory if present. If you wish to include a file named scriptPath in the generated output, you can name it scriptPath.tmpl.
A global variable named context will be available in the JS VM. It will contain the scaffolder.Config.Context value.
Existing template functions will also be available in the JS VM.
Types ¶
Click to show internal directories.
Click to hide internal directories.