1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 18:01:16 +02:00

Single page for experimental feature descriptions

As requested by @fricklerhandwerk.
This commit is contained in:
John Ericson 2023-04-09 11:01:23 -04:00
parent bc192a95ef
commit 73eb6a2a57
6 changed files with 15 additions and 22 deletions

View file

@ -1,21 +1,11 @@
xps:
with builtins;
with import ./utils.nix;
let
makePage = { name, value }:
{
name = "${name}.md";
inherit value;
feature = name;
};
showExperimentalFeature = name: doc:
squash ''
## [`${name}`]{#xp-feature-${name}}
featurePages = map makePage (attrsToList xps);
tableOfContents = let
showEntry = page:
" - [${page.feature}](contributing/experimental-features/${page.name})";
in concatStringsSep "\n" (map showEntry featurePages) + "\n";
in (listToAttrs featurePages) // { "SUMMARY.md" = tableOfContents; }
${doc}
'';
in xps: (concatStringsSep "\n" (attrValues (mapAttrs showExperimentalFeature xps)))