docs/mdbook: only include sub-options of visible options

E.g. rename aliases that target the `settings` option shouldn't show the
`settings` sub-options under the `visible=false` alias.
This commit is contained in:
Matt Sturgeon 2024-06-25 17:47:31 +01:00
parent 4958ac06d3
commit 1fdbf40c17
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -37,7 +37,8 @@ let
removeWhitespace = builtins.replaceStrings [ " " ] [ "" ];
getSubOptions = opts: path: removeUnwanted (opts.type.getSubOptions path);
getSubOptions =
opts: path: optionalAttrs (isVisible opts) (removeUnwanted (opts.type.getSubOptions path));
isVisible =
opts: