diff options
-rw-r--r-- | doc/manual/utils.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/manual/utils.nix b/doc/manual/utils.nix index ce0c21c98..c0a40c9ff 100644 --- a/doc/manual/utils.nix +++ b/doc/manual/utils.nix @@ -48,6 +48,7 @@ rec { ${indent " " body} ''; + # separate body to cleanly handle indentation body = '' ${description} @@ -56,6 +57,7 @@ rec { ${showAliases aliases} ''; + showDefault = documentDefault: defaultValue: if documentDefault then # a StringMap value type is specified as a string, but @@ -67,12 +69,15 @@ rec { if defaultValue then "`true`" else "`false`" else "`${toString defaultValue}`" else "*machine-specific*"; + showAliases = aliases: if aliases == [] then "" else "**Deprecated alias:** ${(concatStringsSep ", " (map (s: "`${s}`") aliases))}"; + indent = prefix: s: concatStringsSep "\n" (map (x: if x == "" then x else "${prefix}${x}") (splitLines s)); - in result; + + in result; showSettings = useSpans: settingsInfo: concatStrings (attrValues (mapAttrs (showSetting useSpans) settingsInfo)); } |