aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorArthur Gautier <arthur.gautier@arista.com>2021-12-01 16:08:23 +0100
committerArthur Gautier <arthur.gautier@arista.com>2021-12-01 17:25:58 +0100
commit21520297dad8a198004e4551808a4818a8de7ddd (patch)
treea69a5c19b1528a88414401c3066e266c0983ebb5 /doc
parent1a9bfdc4ca0c2786b02801540432badbafa3a811 (diff)
reproducibility: hide non-reproducible settings from manual
Because the manual is generated from default values which are themselves generated from various sources (cpuid, bios settings (kvm), number of cores). This commit hides non-reproducible settings from the manual output.
Diffstat (limited to 'doc')
-rw-r--r--doc/manual/generate-options.nix24
1 files changed, 13 insertions, 11 deletions
diff --git a/doc/manual/generate-options.nix b/doc/manual/generate-options.nix
index 3c31a4eec..9a77f4d36 100644
--- a/doc/manual/generate-options.nix
+++ b/doc/manual/generate-options.nix
@@ -8,17 +8,19 @@ concatStrings (map
let option = options.${name}; in
" - `${name}` \n\n"
+ concatStrings (map (s: " ${s}\n") (splitLines option.description)) + "\n\n"
- + " **Default:** " + (
- if option.value == "" || option.value == []
- then "*empty*"
- else if isBool option.value
- then (if option.value then "`true`" else "`false`")
- else
- # n.b. a StringMap value type is specified as a string, but
- # this shows the value type. The empty stringmap is "null" in
- # JSON, but that converts to "{ }" here.
- (if isAttrs option.value then "`\"\"`"
- else "`" + toString option.value + "`")) + "\n\n"
+ + (if option.documentDefault
+ then " **Default:** " + (
+ if option.value == "" || option.value == []
+ then "*empty*"
+ else if isBool option.value
+ then (if option.value then "`true`" else "`false`")
+ else
+ # n.b. a StringMap value type is specified as a string, but
+ # this shows the value type. The empty stringmap is "null" in
+ # JSON, but that converts to "{ }" here.
+ (if isAttrs option.value then "`\"\"`"
+ else "`" + toString option.value + "`")) + "\n\n"
+ else " **Default:** *machine-specific*")
+ (if option.aliases != []
then " **Deprecated alias:** " + (concatStringsSep ", " (map (s: "`${s}`") option.aliases)) + "\n\n"
else "")