From 60e88b870c8477bcb043792025eca4c9bb4974e3 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Fri, 27 Dec 2024 20:20:10 +0000 Subject: [PATCH] docs: treat internal options as invisible `internal` options are intended to be implicitly not `visible`. This is already handled correctly by the nixos tooling, but our custom tooling did not correctly handle the edge case. This lead to strange cases where an internal option is not included in the docs, but its sub-options were still visible. --- docs/mdbook/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/mdbook/default.nix b/docs/mdbook/default.nix index e70e0c4e..4b7be53d 100644 --- a/docs/mdbook/default.nix +++ b/docs/mdbook/default.nix @@ -41,9 +41,9 @@ let isVisible = opts: if lib.isOption opts then - opts.visible or true + opts.visible or true && !(opts.internal or false) else if opts.isOption then - opts.index.options.visible or true + opts.index.options.visible or true && !(opts.index.options.internal or false) else let filterFunc = lib.filterAttrs (_: v: if lib.isAttrs v then isVisible v else true);