docs/mdbook: simplify isVisible

This commit is contained in:
Matt Sturgeon 2024-06-25 17:41:42 +01:00
parent 066485bf4c
commit 4958ac06d3
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -42,13 +42,9 @@ let
isVisible =
opts:
if isOption opts then
attrByPath [ "visible" ] true opts
opts.visible or true
else if opts.isOption then
attrByPath [
"index"
"options"
"visible"
] true opts
opts.index.options.visible or true
else
let
filterFunc = filterAttrs (_: v: if isAttrs v then isVisible v else true);