diff options
author | Vincent Ambo <tazjin@tvl.su> | 2023-09-08T12·49+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2023-09-08T13·51+0000 |
commit | c5770e65dd2dd82509da245cd6afc3077bca7d2b (patch) | |
tree | 07f0f352ac98bed8ba5d501600943881c1baee29 /nix/renderMarkdown/default.nix | |
parent | 87d63e4a1bd604a0cda6102cad9c59bbce8f792e (diff) |
feat(nix/renderMarkdown): add optional tagfilter argument r/6565
Makes it possible to disable tag filtering for rendered content (on by default, of course). Change-Id: I74ecfee97eaa7abf32049172b28705e7a3f21548 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9276 Tested-by: BuildkiteCI Reviewed-by: Mark Shevchenko <markshevchenko@gmail.com>
Diffstat (limited to 'nix/renderMarkdown/default.nix')
-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 + '' + )) |