2024-05-01 21:16:17 +00:00
|
|
|
{ clan-core, ... }:
|
|
|
|
|
2024-05-01 21:35:14 +00:00
|
|
|
rec {
|
|
|
|
getReadme =
|
2024-05-01 21:16:17 +00:00
|
|
|
modulename:
|
|
|
|
let
|
|
|
|
readme = "${clan-core}/clanModules/${modulename}/README.md";
|
|
|
|
readmeContents =
|
2024-05-01 21:35:14 +00:00
|
|
|
if (builtins.pathExists readme) then
|
2024-05-01 21:16:17 +00:00
|
|
|
(builtins.readFile readme)
|
|
|
|
else
|
2024-05-01 21:35:14 +00:00
|
|
|
throw "No README.md found for module ${modulename}";
|
2024-05-01 21:16:17 +00:00
|
|
|
in
|
|
|
|
readmeContents;
|
2024-05-01 21:35:14 +00:00
|
|
|
|
|
|
|
getShortDescription =
|
|
|
|
modulename:
|
|
|
|
let
|
|
|
|
content = (getReadme modulename);
|
|
|
|
parts = builtins.split "---" content;
|
|
|
|
in
|
|
|
|
if (builtins.length parts) > 0 then
|
|
|
|
builtins.head parts
|
|
|
|
else
|
|
|
|
throw "Short description delimiter `---` not found in README.md for module ${modulename}";
|
2024-05-01 21:16:17 +00:00
|
|
|
}
|