diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-03-21 14:12:15 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-03-21 14:12:15 +0100 |
commit | 3fc4659d22fc3c8cfbffd7322fd6c034efaaa3ab (patch) | |
tree | 7014115abd264da90a4949255d448d657bbbb148 /doc/manual/utils.nix | |
parent | 9eb53bbf17037691e1278c71517d74d0962aa43f (diff) |
Formatting
Diffstat (limited to 'doc/manual/utils.nix')
-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)); } |