tvl-depot/users/tazjin/renderMarkdown.nix
Vincent Ambo 452b8c7e23 refactor(tazjin/blog): Extract post rendering to utility function
To use cheddar for both the feed & web views, the rendering function
is extracted a level up - this prevents duplicate renderer calls.

Change-Id: I31812c5c3f905f2f84914c6a8ab7c14602227be1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1710
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2020-08-10 23:24:44 +00:00

9 lines
249 B
Nix

# Render a Markdown file to HTML.
{ depot, ... }:
with depot.nix.yants;
defun [ path drv ] (file: depot.third_party.runCommandNoCC "${file}.rendered.html" {} ''
cat ${file} | ${depot.tools.cheddar}/bin/cheddar --about-filter ${file} > $out
'')