iditacards/rules.ninja

40 lines
1.2 KiB
Plaintext

rule template2tex
description = convert $in to $out using $template as a template
command = gomplate --left-delim '«' --right-delim '»' -c .=$in < $template > $out
rule cuegen
description = run cue on $in to produce $out
command = cue export $in > $out
rule extract
description = extract $out from $in via jq filter $filter
command = jq $filter < $in | bash update.sh $out
restat = 1
rule tex2pdf
description = render tex from $in to $out
command = $
xelatex $
-interaction=batchmode $
-halt-on-error $
--shell-escape $
--output-directory=$$(dirname $out) $in >/dev/null $
&& [ $$(basename -s .tex $in) = $$(basename -s .pdf $out) ] $
|| mv $$(dirname $out)/$$(basename -s .tex $in).pdf $out
rule scantex
description = scan tex $in for dependencies
command = bash scantex.sh $in $out > $out
rule pdf2png
description = convert pdf $in to png $out with size $w by $h
command = pdftoppm -scale-to-x $w -scale-to-y $h -png $in > $out
rule convert
description = run ImageMagick convert on $in with args $args to $out
command = magick $in $args $out
rule copy
description = copy $in to $out
command = cp $in $out