forked from NixOS/nix
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document each store type on its own page
This makes for more useful manual table of contents, that displays the information at a glance. The `nix help-stores` command is kept as-is, even though it will show up in the manual with the same information as these pages due to the way it is written as a "`--help`-style" command. Deciding what to do with that command is left for a later PR.
- Loading branch information
1 parent
44d21f6
commit 98d2db0
Showing
18 changed files
with
84 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,54 @@ | ||
let | ||
inherit (builtins) attrValues mapAttrs; | ||
inherit (import ./utils.nix) concatStrings optionalString; | ||
showSettings = import ./generate-settings.nix; | ||
inherit (builtins) attrNames listToAttrs concatStringsSep; | ||
inherit (import <nix/utils.nix>) optionalString filterAttrs trim squash unique; | ||
showSettings = import <nix/generate-settings.nix>; | ||
in | ||
|
||
inlineHTML: storesInfo: | ||
{ inlineHTML, stores, headingLevel ? "#" }: | ||
|
||
let | ||
|
||
showStore = name: { settings, doc, experimentalFeature }: | ||
showStore = { name, slug }: { settings, doc, experimentalFeature }: | ||
let | ||
|
||
result = '' | ||
## ${name} | ||
experimentalFeatureNote = optionalString (experimentalFeature != null) '' | ||
> **Warning** | ||
> This store is part of an | ||
> [experimental feature](@docroot@/contributing/experimental-features.md). | ||
To use this store, you need to make sure the corresponding experimental feature, | ||
[`${experimentalFeature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature}), | ||
is enabled. | ||
For example, include the following in [`nix.conf`](#): | ||
``` | ||
extra-experimental-features = ${experimentalFeature} | ||
``` | ||
''; | ||
in '' | ||
${headingLevel} ${name} | ||
${doc} | ||
${experimentalFeatureNote} | ||
### Settings | ||
${headingLevel}# Settings | ||
${showSettings { prefix = "store-${slug}"; inherit inlineHTML; } settings} | ||
''; | ||
|
||
storesList = map | ||
(name: rec { | ||
inherit name; | ||
# markdown doesn't like spaces in URLs | ||
slug = builtins.replaceStrings [ " " ] [ "-" ] name; | ||
filename = "${slug}.md"; | ||
page = showStore { inherit name slug; } stores.${name}; | ||
}) | ||
(attrNames stores); | ||
|
||
experimentalFeatureNote = optionalString (experimentalFeature != null) '' | ||
> **Warning** | ||
> This store is part of an | ||
> [experimental feature](@docroot@/contributing/experimental-features.md). | ||
To use this store, you need to make sure the corresponding experimental feature, | ||
[`${experimentalFeature}`](@docroot@/contributing/experimental-features.md#xp-feature-${experimentalFeature}), | ||
is enabled. | ||
For example, include the following in [`nix.conf`](#): | ||
``` | ||
extra-experimental-features = ${experimentalFeature} | ||
``` | ||
''; | ||
in result; | ||
tableOfContents = let | ||
showEntry = store: | ||
" - [${store.name}](store-types/${store.filename})"; | ||
in concatStringsSep "\n" (map showEntry storesList) + "\n"; | ||
|
||
in concatStrings (attrValues (mapAttrs showStore storesInfo)) | ||
in listToAttrs (map (s: { name = s.filename; value = s.page; }) storesList) // { "SUMMARY.md" = tableOfContents; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,5 +38,3 @@ store as follows: | |
does not exist. | ||
|
||
* Otherwise, use the [local store](#local-store) `/nix/store`. | ||
|
||
@stores@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters