mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-09-20 00:18:05 +03:00
4781e7fa70
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. This change also lists all store types at the top of the respective overview page. Co-authored-by: John Ericson <John.Ericson@Obsidian.Systems
40 lines
936 B
Nix
40 lines
936 B
Nix
let
|
|
inherit (builtins) attrNames listToAttrs concatStringsSep readFile replaceStrings;
|
|
showSettings = import <nix/generate-settings.nix>;
|
|
showStoreDocs = import <nix/generate-store-info.nix>;
|
|
in
|
|
|
|
storeInfo:
|
|
|
|
let
|
|
storesList = showStoreDocs {
|
|
inherit storeInfo;
|
|
inlineHTML = true;
|
|
};
|
|
|
|
index =
|
|
let
|
|
showEntry = store:
|
|
"- [${store.name}](./${store.filename})";
|
|
in
|
|
concatStringsSep "\n" (map showEntry storesList);
|
|
|
|
"index.md" = replaceStrings
|
|
[ "@store-types@" ] [ index ]
|
|
(readFile ./src/store/types/index.md.in);
|
|
|
|
tableOfContents =
|
|
let
|
|
showEntry = store:
|
|
" - [${store.name}](store/types/${store.filename})";
|
|
in
|
|
concatStringsSep "\n" (map showEntry storesList) + "\n";
|
|
|
|
"SUMMARY.md" = tableOfContents;
|
|
|
|
storePages = listToAttrs
|
|
(map (s: { name = s.filename; value = s.page; }) storesList);
|
|
|
|
in
|
|
storePages // { inherit "index.md" "SUMMARY.md"; }
|