diff options
author | Minijackson <minijackson@riseup.net> | 2021-11-10 16:06:31 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2021-11-10 16:06:31 +0100 |
commit | dd3cd5048c13ba5bef5a76444d1b95c3fef91371 (patch) | |
tree | cd60507f7e1a09dc157e1e9ab03d5fc43f9cde26 | |
parent | 92e350985819b7f324007cb92650019e9f6558c6 (diff) | |
download | nix-module-doc-dd3cd5048c13ba5bef5a76444d1b95c3fef91371.tar.gz nix-module-doc-dd3cd5048c13ba5bef5a76444d1b95c3fef91371.zip |
mdbook: add preBuild and postBuild hooks
-rw-r--r-- | mdbook.nix | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -17,6 +17,24 @@ in | |||
17 | ''; | 17 | ''; |
18 | internal = optionsInternal; | 18 | internal = optionsInternal; |
19 | }; | 19 | }; |
20 | |||
21 | preBuild = mkOption { | ||
22 | type = types.lines; | ||
23 | description = '' | ||
24 | Extra commands executed before running `mdbook build`. | ||
25 | ''; | ||
26 | default = ""; | ||
27 | internal = optionsInternal; | ||
28 | }; | ||
29 | |||
30 | postBuild = mkOption { | ||
31 | type = types.lines; | ||
32 | description = '' | ||
33 | Extra commands executed after running `mdbook build`. | ||
34 | ''; | ||
35 | default = ""; | ||
36 | internal = optionsInternal; | ||
37 | }; | ||
20 | }; | 38 | }; |
21 | }; | 39 | }; |
22 | 40 | ||
@@ -37,8 +55,12 @@ in | |||
37 | 55 | ||
38 | cp "${getAttrFromPath (outputAttrPath ++ ["doc-options-md"]) config}" src/options.md | 56 | cp "${getAttrFromPath (outputAttrPath ++ ["doc-options-md"]) config}" src/options.md |
39 | 57 | ||
58 | ${cfg.preBuild} | ||
59 | |||
40 | mdbook build | 60 | mdbook build |
41 | 61 | ||
62 | ${cfg.postBuild} | ||
63 | |||
42 | cp -r book "$out" | 64 | cp -r book "$out" |
43 | ''; | 65 | ''; |
44 | }; | 66 | }; |