aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/generate-builtins.nix
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-01-02 20:53:39 +0100
committerEelco Dolstra <edolstra@gmail.com>2023-01-02 20:53:39 +0100
commit6b6965238506705382892b14ef22700fc5112c3d (patch)
treec5a0f04bee2bace1281d7c7b405c8214641072c8 /doc/manual/generate-builtins.nix
parente0ab2069c975abf80db9fdca23f0c164df921829 (diff)
parent9af16c5f742300e831a2cc400e43df1e22f87f31 (diff)
Merge remote-tracking branch 'origin/master' into coerce-string
Diffstat (limited to 'doc/manual/generate-builtins.nix')
-rw-r--r--doc/manual/generate-builtins.nix32
1 files changed, 18 insertions, 14 deletions
diff --git a/doc/manual/generate-builtins.nix b/doc/manual/generate-builtins.nix
index 6c8b88da2..115bb3f94 100644
--- a/doc/manual/generate-builtins.nix
+++ b/doc/manual/generate-builtins.nix
@@ -1,16 +1,20 @@
-with builtins;
-with import ./utils.nix;
+builtinsDump:
+let
+ showBuiltin = name:
+ let
+ inherit (builtinsDump.${name}) doc args;
+ in
+ ''
+ <dt id="builtins-${name}">
+ <a href="#builtins-${name}"><code>${name} ${listArgs args}</code></a>
+ </dt>
+ <dd>
-builtins:
+ ${doc}
+
+ </dd>
+ '';
+ listArgs = args: builtins.concatStringsSep " " (map (s: "<var>${s}</var>") args);
+in
+with builtins; concatStringsSep "\n" (map showBuiltin (attrNames builtinsDump))
-concatStrings (map
- (name:
- let builtin = builtins.${name}; in
- "<dt id=\"builtins-${name}\"><a href=\"#builtins-${name}\"><code>${name} "
- + concatStringsSep " " (map (s: "<var>${s}</var>") builtin.args)
- + "</code></a></dt>"
- + "<dd>\n\n"
- + builtin.doc
- + "\n\n</dd>"
- )
- (attrNames builtins))