Merge pull request #174470 from hercules-ci/module-docs-visibility-override
make-options-doc: Allow transformOptions to override visibility
This commit is contained in:
commit
9970c0b874
@ -47,8 +47,11 @@ let
|
||||
else if lib.isFunction x then "<function>"
|
||||
else x;
|
||||
|
||||
optionsList = lib.flip map optionsListVisible
|
||||
(opt: transformOptions opt
|
||||
rawOpts = lib.optionAttrSetToDocList options;
|
||||
transformedOpts = map transformOptions rawOpts;
|
||||
filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts;
|
||||
optionsList = lib.flip map filteredOpts
|
||||
(opt: opt
|
||||
// lib.optionalAttrs (opt ? example) { example = substSpecial opt.example; }
|
||||
// lib.optionalAttrs (opt ? default) { default = substSpecial opt.default; }
|
||||
// lib.optionalAttrs (opt ? type) { type = substSpecial opt.type; }
|
||||
@ -90,9 +93,6 @@ let
|
||||
'';
|
||||
in "<itemizedlist>${lib.concatStringsSep "\n" (map (p: describe (unpack p)) packages)}</itemizedlist>";
|
||||
|
||||
# Remove invisible and internal options.
|
||||
optionsListVisible = lib.filter (opt: opt.visible && !opt.internal) (lib.optionAttrSetToDocList options);
|
||||
|
||||
optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList);
|
||||
|
||||
in rec {
|
||||
|
Loading…
Reference in New Issue
Block a user