diff options
Diffstat (limited to 'nix/renderMarkdown')
-rw-r--r-- | nix/renderMarkdown/default.nix | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/nix/renderMarkdown/default.nix b/nix/renderMarkdown/default.nix index c5e830c83409..8759ada0fe3b 100644 --- a/nix/renderMarkdown/default.nix +++ b/nix/renderMarkdown/default.nix @@ -3,6 +3,19 @@ with depot.nix.yants; -defun [ path drv ] (file: pkgs.runCommand "${file}.rendered.html" { } '' - cat ${file} | ${depot.tools.cheddar}/bin/cheddar --about-filter ${file} > $out -'') +let + args = struct "args" { + path = path; + tagfilter = option bool; + }; +in +defun [ (either path args) drv ] + (arg: pkgs.runCommand "${arg.path or arg}.rendered.html" { } + ( + let + tagfilter = if (arg.tagfilter or true) then "" else "--no-tagfilter"; + in + '' + cat ${arg.path or arg} | ${depot.tools.cheddar}/bin/cheddar --about-filter ${tagfilter} ${arg.path or arg} > $out + '' + )) |