feat: enumerate all hierarchical paths for option's parents facet
2 files changed, 9 insertions(+), 6 deletions(-)
changed files
M internal/importer/options.go → internal/importer/options.go
@@ -172,14 +172,17 @@ if v, ok := x["example"].(map[string]any); ok { exampleDocs = i.convertDocsValue(v) } - var parents string - if len(loc) > 1 { - parents = strings.Join(loc[:len(loc)-1], ".") - } - var optionSet string + var parents []string if len(loc) >= 1 { + // Top-level parent -> optionSet optionSet = loc[0] + + for i := 1; i < len(loc); i++ { + parents = append(parents, + strings.Join(loc[:i], "."), + ) + } } // log.Debug("sending option", "name", kv.Key)
M internal/nix/option.go → internal/nix/option.go
@@ -26,7 +26,7 @@ Description nixdocs.Markdown Example *Docs `json:",omitempty"` Loc []string OptionSet string - Parents string + Parents []string RelatedPackages nixdocs.Markdown `json:",omitempty"` Type string ImportedAt time.Time