readme: fixed formatting issue and added tip
This commit is contained in:
parent
733c486cb2
commit
3fa7b80802
1 changed files with 6 additions and 4 deletions
10
README.md
10
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
|
// this MUST be named "Generator" for symbol lookup in main driver
|
||||||
var Generator MyGenerator
|
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.
|
Finally, build the plugin and put it somewhere specified by `plugins` in your config. Make sure that the package is `main` before building.
|
||||||
|
|
||||||
```bash
|
```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.
|
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
|
## Configuration
|
||||||
|
|
||||||
Here is an example config file to start using configurator:
|
Here is an example config file to start using configurator:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue