From 76a8790764ec983ca0659c952c4b6924c4e9bf1a Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 25 Jun 2024 17:47:31 +0100 Subject: [PATCH] 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. --- docs/mdbook/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/mdbook/default.nix b/docs/mdbook/default.nix index d0a58674..1f8cbf45 100644 --- a/docs/mdbook/default.nix +++ b/docs/mdbook/default.nix @@ -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: