[installer] add doc generator for Config
#9165
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a small script that can be invoked from the
Makefile
that will create aMarkdown
document from the definition of theConfig
structThis is a proposal to add extra tags and/or comments to the struct definition that will get by this newly added script. You can try running the script with:
This script will basically look for the
Config
struct in a file./pkg/config/v1/config.go
(or whichever version you choose). Following are the info the script is hoping to extract:json
tagvalidate
tagdoc
For example:
The above struct will produce the following output in
./pkg/config/v1/config.md
:Config
Config is the struct we care about
Supported parameters
kind
code
domain
Other than the
json
tag, every other tag is optional.Related Issue(s)
Fixes #8441
How to test
To test immediately, one can simply run:
$ go run ./scripts/structtag.go # default version is `v1`
You can see the output in the file
./pkg/config/v1/config.md
.To see a more elaborate doc created, add Doc comments(the ones that are given in the line above to the code) and
doc
tags to theConfig
fields and re-run the above command.Release Notes
Documentation
/werft no-preview