forked from lix-project/lix
22b278e011
This is done in roughly the same way builtin functions are documented. Also auto-link experimental features for primops, subsuming PR #8371. Co-authored-by: Eelco Dolstra <edolstra@gmail.com> Co-authored-by: Robert Hensing <roberth@users.noreply.github.com> Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
30 lines
713 B
Nix
30 lines
713 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 ''
|
|
Not available in [pure evaluation mode](@docroot@/command-ref/conf-file.md#conf-pure-eval).
|
|
'';
|
|
in
|
|
squash ''
|
|
<dt id="builtin-constants-${name}">
|
|
<a href="#builtin-constants-${name}"><code>${name}</code>${type'}</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
${doc}
|
|
|
|
${impureNotice}
|
|
|
|
</dd>
|
|
'';
|
|
in
|
|
concatStringsSep "\n" (attrValues (mapAttrs showBuiltin builtinsInfo))
|