2023-05-03 10:16:29 +03:00
let
2023-05-13 20:52:45 +03:00
inherit ( builtins ) concatStringsSep attrValues mapAttrs ;
2023-11-30 22:41:47 +02:00
inherit ( import <nix/utils.nix> ) optionalString squash ;
2023-05-03 10:16:29 +03:00
in
builtinsInfo :
2022-11-24 14:47:08 +02:00
let
2023-05-13 20:52:45 +03:00
showBuiltin = name : { doc , args , arity , experimental-feature }:
2022-11-24 14:47:08 +02:00
let
2023-05-13 20:52:45 +03:00
experimentalNotice = optionalString ( experimental-feature != null ) ''
2023-12-10 07:16:32 +02:00
> * * Note * *
>
> This function is only available if the [ ` $ { experimental-feature } ` experimental feature ] ( @ docroot @ /contributing/experimental-features.md #xp-feature-${experimental-feature}) is enabled.
>
> For example , include the following in [ ` nix . conf ` ] ( @ docroot @ /command-ref/conf-file.md ) :
>
> ` ` `
> extra-experimental-features = $ { experimental-feature }
> ` ` `
2023-05-13 20:52:45 +03:00
'' ;
2022-11-24 14:47:08 +02:00
in
2023-05-13 20:52:45 +03:00
squash ''
2022-11-24 14:47:08 +02:00
< dt id = " b u i l t i n s - ${ name } " >
< a href = " # b u i l t i n s - ${ name } " > <code> $ { name } $ { listArgs args } < /code > < /a >
< /dt >
<dd>
2020-09-16 15:55:24 +03:00
2023-05-13 20:52:45 +03:00
$ { experimentalNotice }
2022-11-24 14:47:08 +02:00
2023-12-10 07:16:32 +02:00
$ { doc }
2022-11-24 14:47:08 +02:00
< /dd >
'' ;
2023-05-03 10:16:29 +03:00
listArgs = args : concatStringsSep " " ( map ( s : " < v a r > ${ s } < / v a r > " ) args ) ;
2022-11-24 14:47:08 +02:00
in
2023-05-13 20:52:45 +03:00
concatStringsSep " \n " ( attrValues ( mapAttrs showBuiltin builtinsInfo ) )