1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/scripts/pdf/build-pdf.sh
K.B.Dharun Krishna 10e2c5b145
Revert "build-pdf: only build changed folders since last commit" (#11795)
Revert "build-pdf: only build changed folders since last commit (#11773)"

This reverts commit 1de7b5a80b.
2023-12-19 17:40:57 +05:30

33 lines
732 B
Bash

#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# This script is executed by GitHub Actions when a PR is merged (i.e. in the `Build PDF` step).
set -ex
function process_page {
pageDir="$1"
folder=$(basename "${pageDir}")
language="${folder##*.}"
case $folder in
pages.bn | pages.ja | pages.ko | pages.ml | pages.ta | pages.th | pages.zh | pages.zh_TW)
;;
pages)
python3 render.py "${pageDir}" -c solarized-light
;;
*)
python3 render.py "${pageDir}" -c basic -o "tldr-book-${language}.pdf"
;;
esac
}
function main {
for pageDir in ../../pages*; do
process_page "${pageDir}"
done
}
###################################
# MAIN
###################################
main