lix/doc/manual/generate-store-info.nix
Valentin Gagarin 0301b8fc73 reword the experimental feature notice
- put the highlight box around all the relevant instructions
- simplify the wording
- make the link more prominent by using the whole phrase for the link text
2023-11-30 23:24:53 +01:00

46 lines
1.3 KiB
Nix

let
inherit (builtins) attrValues mapAttrs;
inherit (import <nix/utils.nix>) concatStrings optionalString squash;
showSettings = import <nix/generate-settings.nix>;
in
inlineHTML: storesInfo:
let
showStore = name: { settings, doc, experimentalFeature }:
let
result = squash ''
# ${name}
${doc}
${experimentalFeatureNote}
## Settings
${showSettings { prefix = "store-${slug}"; inherit inlineHTML; } settings}
'';
# markdown doesn't like spaces in URLs
slug = builtins.replaceStrings [ " " ] [ "-" ] name;
experimentalFeatureNote = optionalString (experimentalFeature != null) ''
> **Warning**
>
> This store is part of an
> [experimental feature](@docroot@/contributing/experimental-features.md).
>
> To use this store, make sure the
> [`${experimentalFeature}` experimental feature](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature})
> is enabled.
> For example, include the following in [`nix.conf`](@docroot@/command-ref/conf-file.md):
>
> ```
> extra-experimental-features = ${experimentalFeature}
> ```
'';
in result;
in concatStrings (attrValues (mapAttrs showStore storesInfo))