2020-08-10 23:48:05 +02:00
|
|
|
# Render a Markdown file to HTML.
|
2021-04-10 18:05:16 +02:00
|
|
|
{ depot, pkgs, ... }:
|
2020-08-10 23:48:05 +02:00
|
|
|
|
|
|
|
with depot.nix.yants;
|
|
|
|
|
2023-09-08 14:49:38 +02:00
|
|
|
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
|
|
|
|
''
|
|
|
|
))
|