talks/justfile

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1 KiB
Makefile
Raw Normal View History

2024-04-21 22:07:57 +00:00
pdf_filename := 'slides.pdf'
thumbnail_filename := 'thumbnail.jpg'
_default:
2024-04-21 22:07:57 +00:00
@just --list
clean:
rm -fr dist/*
touch dist/.keep
find . \
-type f \( -name "{{ pdf_filename }}" -o -name *.build_temp -o -name {{ thumbnail_filename }} \) \
-delete
generate talk_path filename="slides.rst": (generate-pdf talk_path filename)
2024-04-21 22:07:57 +00:00
generate-pdf talk_path filename="slides.rst":
#!/usr/bin/env bash
set -o errexit
set -o nounset
talk_slug=$(basename {{ talk_path }})
pushd "{{ talk_path }}"
rst2pdf {{ filename }} \
2024-04-21 22:07:57 +00:00
--break-level 1 \
-e preprocess \
--fit-background-mode scale \
--font-path ../fonts \
--output "../../dist/${talk_slug}.pdf" \
2024-05-09 12:57:30 +00:00
--stylesheets opdavies-light,igor \
2024-05-09 09:45:06 +00:00
--stylesheet-path ../styles
2024-04-21 22:07:57 +00:00
popd
2024-04-21 22:07:57 +00:00
tree dist
present slides_path duration *args:
pdfpc {{ slides_path }} --duration={{ duration }} {{ args }}
watch slides_path rst_file="slides.rst":
find justfile src/styles {{ slides_path }} -type f | \
entr just generate-pdf {{ slides_path }} {{ rst_file }}