Oliver Davies
ea3fcd0704
Pass the path to the talk directory - e.g. `just generate ./src/test-driven-drupal` instead of just the talk name/slug. This doesn't change where the files are sourced from or output, but this makes it easier to use `just generate` as I can use tab completion when executing the command - making it quicker and less prone to typos.
39 lines
760 B
Makefile
39 lines
760 B
Makefile
pdf_filename := 'slides.pdf'
|
|
rst_filename := 'slides.rst'
|
|
thumbnail_filename := 'thumbnail.jpg'
|
|
|
|
default:
|
|
@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: (generate-pdf talk_path)
|
|
|
|
generate-pdf talk_path:
|
|
#!/usr/bin/env bash
|
|
set -o errexit
|
|
set -o nounset
|
|
|
|
talk_slug=$(basename {{ talk_path }})
|
|
|
|
pushd "{{ talk_path }}"
|
|
|
|
rst2pdf {{ rst_filename }} \
|
|
--break-level 1 \
|
|
-e preprocess \
|
|
--fit-background-mode scale \
|
|
--font-path ../fonts \
|
|
--output "../../dist/${talk_slug}.pdf" \
|
|
--stylesheets opdavies-light,tango \
|
|
--stylesheet-path ../styles
|
|
|
|
popd
|
|
|
|
tree dist
|