diff options
Diffstat (limited to 'nix/renderMarkdown/default.nix')
-rw-r--r-- | nix/renderMarkdown/default.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nix/renderMarkdown/default.nix b/nix/renderMarkdown/default.nix new file mode 100644 index 000000000000..8759ada0fe3b --- /dev/null +++ b/nix/renderMarkdown/default.nix @@ -0,0 +1,21 @@ +# Render a Markdown file to HTML. +{ depot, pkgs, ... }: + +with depot.nix.yants; + +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 + '' + )) |