mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-16 03:06:17 +02:00
0e4f6dfcf7
the original change broke many pre-existing anchor links. also change formatting of the constants listing slightly: - the type should not be part of the anchor - add highlight to the "impure only" note
31 lines
726 B
Nix
31 lines
726 B
Nix
let
|
|
inherit (builtins) concatStringsSep attrValues mapAttrs;
|
|
inherit (import ./utils.nix) optionalString squash;
|
|
in
|
|
|
|
builtinsInfo:
|
|
let
|
|
showBuiltin = name: { doc, type, impure-only }:
|
|
let
|
|
type' = optionalString (type != null) " (${type})";
|
|
|
|
impureNotice = optionalString impure-only ''
|
|
> **Note**
|
|
>
|
|
> Not available in [pure evaluation mode](@docroot@/command-ref/conf-file.md#conf-pure-eval).
|
|
'';
|
|
in
|
|
squash ''
|
|
<dt id="builtins-${name}">
|
|
<a href="#builtins-${name}"><code>${name}</code></a>${type'}
|
|
</dt>
|
|
<dd>
|
|
|
|
${doc}
|
|
|
|
${impureNotice}
|
|
|
|
</dd>
|
|
'';
|
|
in
|
|
concatStringsSep "\n" (attrValues (mapAttrs showBuiltin builtinsInfo))
|