diff --git a/README.md b/README.md index 76521a5..ca94345 100644 --- a/README.md +++ b/README.md @@ -154,14 +154,13 @@ func (g *MyGenerator) Generate(config *configurator.Config, opts ...util.Option) } } -> [!NOTE] -> The keys in `generator.ApplyTemplate` must not contain illegal characters such as a `-` or else the templates will not apply correctly. - - // this MUST be named "Generator" for symbol lookup in main driver var Generator MyGenerator ``` +> [!NOTE] +> The keys in `generator.ApplyTemplate` must not contain illegal characters such as a `-` or else the templates will not apply correctly. + Finally, build the plugin and put it somewhere specified by `plugins` in your config. Make sure that the package is `main` before building. ```bash @@ -170,6 +169,9 @@ go build -buildmode=plugin -o lib/mygenerator.so path/to/mygenerator.go Now your plugin should be available to use with the `configurator` main driver program. If you get an error about not loading the correct symbol type, make sure that your generator function definitions match the `Generator` interface entirely and that you don't have a partially implemented interface. +> [!TIP] +> See the `examples/test.go` file for a plugin and template example. + ## Configuration Here is an example config file to start using configurator: