talks/run

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

58 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -e
PDF_FILENAME=slides.pdf
RST_FILENAME=slides.rst
THUMBNAIL_FILENAME=thumbnail.jpg
function clean {
rm -fr dist/*
2023-10-17 08:36:46 +00:00
touch dist/.keep
find . \
-type f \( -name "${PDF_FILENAME}*" -o -name *.build_temp -o -name ${THUMBNAIL_FILENAME} \) \
-delete
}
function help {
printf "%s <task> [args]\n\nTasks:\n" "${0}"
compgen -A function | grep -v "^_" | cat -n
printf "\nExtended help:\n Each task has comments for general usage\n"
}
function pdf:generate {
DIRECTORY_NAME=$1
shift 1
pushd "src/${DIRECTORY_NAME}"
rst2pdf "${RST_FILENAME}" \
--break-level 1 \
-e preprocess \
--fit-background-mode scale \
--font-path ../fonts \
--output "../../dist/${DIRECTORY_NAME}.pdf" \
2023-10-17 08:36:46 +00:00
--stylesheets ../styles/style-light,vs \
"${@}"
popd
tree dist
}
2021-12-09 21:16:18 +00:00
function pdf:present {
TALK_PATH=$1
shift 1
pdfpc "${@}" "dist/${TALK_PATH}.pdf" --switch-screens
}
function thumbnail:generate {
# Generate a thumbnail image of the first slide in the presentation.
echo "TODO: thumbnail:generate"
}
TIMEFORMAT=$'\nTask completed in %3lR'
time "${@:-help}"