wellnessgame/src/preface/justfile

33 lines
716 B
Plaintext

src:="preface"
# show all recipes
default:
just --list --unsorted
# make text
@txt:
[ {{src}}.t -nt {{src}}.txt ] \
&& nroff -t -ms {{src}}.t > {{src}}.txt \
|| echo "Nothing to be done"
# make html
@html:
[ {{src}}.t -nt {{src}}.html ] \
&& sed '/tbl start/,/tbl end/ s/^/.\\" /' {{src}}.t \
| sed '/markdown start/,/markdown end/ s/^\.\\" //' \
| sed '/:::/d' \
| groff -ms -Thtml \
| gsed "/style type/a body { max-width: 80ch; margin-inline: auto; }" \
> {{src}}.html \
|| echo "Nothing to be done"
# make pdf
@pdf:
[ {{src}}.t -nt {{src}}.pdf ] \
&& cat {{src}}.t | groff -ms -t -Tpdf > {{src}}.pdf \
|| echo "Nothing to be done"
# make text html and pdf
build: txt html pdf