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:
parent
bc192a95ef
commit
73eb6a2a57
6 changed files with 15 additions and 22 deletions
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue