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 =
|
patchPhase =
|
||||||
let
|
let
|
||||||
shouldExclude = relPath: lib.any (pattern: builtins.match pattern relPath != null) excluded;
|
relPath = file: lib.removePrefix (toString ../. + "/") (toString file);
|
||||||
|
|
||||||
nixFiles =
|
nixFiles =
|
||||||
with lib.fileset;
|
with lib.fileset;
|
||||||
let
|
lib.filter (file: !(lib.any (pattern: builtins.match pattern (relPath file) != null) excluded)) (
|
||||||
allFiles = toList (fileFilter (f: f.hasExt "nix") ../.);
|
toList (fileFilter (f: f.hasExt "nix") ../.)
|
||||||
in
|
);
|
||||||
lib.filter (
|
|
||||||
file:
|
|
||||||
let
|
|
||||||
relPath = lib.removePrefix (toString ../. + "/") (toString file);
|
|
||||||
in
|
|
||||||
!shouldExclude relPath
|
|
||||||
) allFiles;
|
|
||||||
|
|
||||||
chapters = lib.sort (a: b: a.sortKey < b.sortKey) (
|
chapters = lib.sort (a: b: a.sortKey < b.sortKey) (
|
||||||
map (
|
map (
|
||||||
file:
|
file:
|
||||||
let
|
let
|
||||||
|
|
||||||
relPath = lib.removePrefix (toString ../. + "/") (toString file);
|
|
||||||
mdPath =
|
mdPath =
|
||||||
(
|
(
|
||||||
if baseNameOf file == "default.nix" then
|
if baseNameOf file == "default.nix" then
|
||||||
lib.removeSuffix "/" (dirOf relPath)
|
lib.removeSuffix "/" (dirOf (relPath file))
|
||||||
else
|
else
|
||||||
lib.removeSuffix ".nix" relPath
|
lib.removeSuffix ".nix" (relPath file)
|
||||||
)
|
)
|
||||||
+ ".md";
|
+ ".md";
|
||||||
|
|
||||||
|
|
@ -55,7 +45,7 @@ stdenvNoCC.mkDerivation {
|
||||||
hosts = 3;
|
hosts = 3;
|
||||||
users = 4;
|
users = 4;
|
||||||
};
|
};
|
||||||
order = orderMap.${lib.head (lib.splitString "/" relPath)};
|
order = orderMap.${lib.head (lib.splitString "/" (relPath file))};
|
||||||
|
|
||||||
category = lib.removeSuffix ".md" (lib.replaceStrings [ "/" ] [ "." ] mdPath);
|
category = lib.removeSuffix ".md" (lib.replaceStrings [ "/" ] [ "." ] mdPath);
|
||||||
title =
|
title =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue