Use the talk path instead of just the name
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.
This commit is contained in:
parent
4f6ca80035
commit
ea3fcd0704
21
justfile
21
justfile
|
@ -13,19 +13,26 @@ clean:
|
|||
-type f \( -name "{{ pdf_filename }}" -o -name *.build_temp -o -name {{ thumbnail_filename }} \) \
|
||||
-delete
|
||||
|
||||
generate name: (generate-pdf name)
|
||||
generate talk_path: (generate-pdf talk_path)
|
||||
|
||||
generate-pdf name:
|
||||
cd src/{{ name }} && rst2pdf {{ rst_filename }} \
|
||||
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/{{ name }}.pdf \
|
||||
--output "../../dist/${talk_slug}.pdf" \
|
||||
--stylesheets opdavies-light,tango \
|
||||
--stylesheet-path ../styles
|
||||
|
||||
tree dist
|
||||
popd
|
||||
|
||||
present name:
|
||||
pdfpc "dist/{{ name }}.pdf"
|
||||
tree dist
|
||||
|
|
Loading…
Reference in a new issue