[WIP] docs: script for generating config docs#4292
Conversation
Signed-off-by: Woradorn Laodhanadhaworn <woradorn.laon@gmail.com>
|
Heya @lookharm 👋 Thanks so much for giving this a go - nice work so far! 🎉 The only thing that you don't have there that I think would be really nice would be a way of printing out values from the target BTW - if you don't mind me asking, how did you come across the issue? I genuinely wasn't expecting anyone to pick it up so soon, so thanks!
The logic in I'm not sure where the little tool to do this would be though - for now, feel free to put it anywhere (like under Then we'd just do something like this in |
|
Thanks for the response. After thinking about this.
According to type Config struct {
Debug true `toml: "debug", comment: "Debug is bool"`
}
func main() {
out, _ := toml.Marshal(Config{Debug: true})
fmt.Println(string(out))
}The output is: # Debug is bool
debug = trueThis way, it is easier and doesn't require any TOML parsing that go-toml package has done.
I often use Docker and just want to learn more about how the internal works, I hope the contributions will help me, and I think the buildkit is a good starting point. If any issues that you see are good for the starter, please tell me. |
|
Ahhh the TOML marshaller would be nice - but, I don't really like the pattern of reading the comments from a separate field. It means everything has to be in a sine line, which is not very easy to read or edit. If we could keep the comments as go-style doc comments, I think using the TOML marshaller would be perfect! That said, I'd be happy to be persuaded if there's really no easy way to do this in code. |
|
@lookharm just wanted to check-in - are you blocked on this, anything you need help with from our end? No rush, I've just been thinking about improving the config docs as well, and this was on-theme with that. |
|
I'm closing this because the PR is in draft and seems to have stalled. If this is something you're still interested in picking up, please open a new PR when it is ready to be reviewed. Thanks. |
This pr introduces an initial solution to extract comments associated with a Config struct and then generate the config docs. The current implementation only supports single-level structs; nested structs are not supported yet. It will solve issue #4274. If this initial approach is accepted, I plan to make it complete.
A few questions to make it clearer:
(cc @jedevc)