2023-01-22 03:46:32 +03:00
|
|
|
{ pkgs, myLib }:
|
|
|
|
|
|
|
|
{
|
|
|
|
book =
|
|
|
|
let
|
|
|
|
inherit (pkgs) lib;
|
2023-03-20 06:57:15 +03:00
|
|
|
root = myLib.path ./..;
|
2023-01-22 03:46:32 +03:00
|
|
|
rootPrefix = toString root;
|
|
|
|
cleanedSrc = lib.cleanSourceWith {
|
|
|
|
src = root;
|
|
|
|
filter = path: _:
|
|
|
|
let
|
|
|
|
relativePath = lib.removePrefix rootPrefix path;
|
|
|
|
in
|
|
|
|
lib.any (prefix: lib.hasPrefix prefix relativePath) [
|
|
|
|
"/docs" # Build the docs directory
|
|
|
|
"/examples" # But also include examples as we cross-reference them
|
|
|
|
"/README.md"
|
|
|
|
"/CHANGELOG.md"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in
|
|
|
|
pkgs.runCommand "crane-book" { } ''
|
|
|
|
${pkgs.mdbook}/bin/mdbook build --dest-dir $out ${cleanedSrc}/docs
|
|
|
|
'';
|
|
|
|
|
2023-04-02 21:19:35 +03:00
|
|
|
crane-utils = myLib.callPackage ./crane-utils { };
|
2023-01-22 03:46:32 +03:00
|
|
|
}
|