From 3fa7b808022459950e33eae8274d2a794992a614 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Tue, 7 Jan 2025 13:11:25 -0700 Subject: [PATCH] readme: fixed formatting issue and added tip --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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: