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 }} \) \
|
-type f \( -name "{{ pdf_filename }}" -o -name *.build_temp -o -name {{ thumbnail_filename }} \) \
|
||||||
-delete
|
-delete
|
||||||
|
|
||||||
generate name: (generate-pdf name)
|
generate talk_path: (generate-pdf talk_path)
|
||||||
|
|
||||||
generate-pdf name:
|
generate-pdf talk_path:
|
||||||
cd src/{{ name }} && rst2pdf {{ rst_filename }} \
|
#!/usr/bin/env bash
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
|
talk_slug=$(basename {{ talk_path }})
|
||||||
|
|
||||||
|
pushd "{{ talk_path }}"
|
||||||
|
|
||||||
|
rst2pdf {{ rst_filename }} \
|
||||||
--break-level 1 \
|
--break-level 1 \
|
||||||
-e preprocess \
|
-e preprocess \
|
||||||
--fit-background-mode scale \
|
--fit-background-mode scale \
|
||||||
--font-path ../fonts \
|
--font-path ../fonts \
|
||||||
--output ../../dist/{{ name }}.pdf \
|
--output "../../dist/${talk_slug}.pdf" \
|
||||||
--stylesheets opdavies-light,tango \
|
--stylesheets opdavies-light,tango \
|
||||||
--stylesheet-path ../styles
|
--stylesheet-path ../styles
|
||||||
|
|
||||||
tree dist
|
popd
|
||||||
|
|
||||||
present name:
|
tree dist
|
||||||
pdfpc "dist/{{ name }}.pdf"
|
|
||||||
|
|
Loading…
Reference in a new issue