refactor(docs): cleanup variables
This commit is contained in:
parent
645fa542ee
commit
7d3133cc3c
1 changed files with 7 additions and 17 deletions
|
|
@ -18,33 +18,23 @@ stdenvNoCC.mkDerivation {
|
|||
];
|
||||
patchPhase =
|
||||
let
|
||||
shouldExclude = relPath: lib.any (pattern: builtins.match pattern relPath != null) excluded;
|
||||
|
||||
relPath = file: lib.removePrefix (toString ../. + "/") (toString file);
|
||||
nixFiles =
|
||||
with lib.fileset;
|
||||
let
|
||||
allFiles = toList (fileFilter (f: f.hasExt "nix") ../.);
|
||||
in
|
||||
lib.filter (
|
||||
file:
|
||||
let
|
||||
relPath = lib.removePrefix (toString ../. + "/") (toString file);
|
||||
in
|
||||
!shouldExclude relPath
|
||||
) allFiles;
|
||||
lib.filter (file: !(lib.any (pattern: builtins.match pattern (relPath file) != null) excluded)) (
|
||||
toList (fileFilter (f: f.hasExt "nix") ../.)
|
||||
);
|
||||
|
||||
chapters = lib.sort (a: b: a.sortKey < b.sortKey) (
|
||||
map (
|
||||
file:
|
||||
let
|
||||
|
||||
relPath = lib.removePrefix (toString ../. + "/") (toString file);
|
||||
mdPath =
|
||||
(
|
||||
if baseNameOf file == "default.nix" then
|
||||
lib.removeSuffix "/" (dirOf relPath)
|
||||
lib.removeSuffix "/" (dirOf (relPath file))
|
||||
else
|
||||
lib.removeSuffix ".nix" relPath
|
||||
lib.removeSuffix ".nix" (relPath file)
|
||||
)
|
||||
+ ".md";
|
||||
|
||||
|
|
@ -55,7 +45,7 @@ stdenvNoCC.mkDerivation {
|
|||
hosts = 3;
|
||||
users = 4;
|
||||
};
|
||||
order = orderMap.${lib.head (lib.splitString "/" relPath)};
|
||||
order = orderMap.${lib.head (lib.splitString "/" (relPath file))};
|
||||
|
||||
category = lib.removeSuffix ".md" (lib.replaceStrings [ "/" ] [ "." ] mdPath);
|
||||
title =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue