scripts: build and deploy PDF pages for translations (#10969)
* scripts: build and deploy PDF pages for translations Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com> * render.py: fix typo in filename description --------- Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
This commit is contained in:

committed by
GitHub

parent
d9ad48e058
commit
e35b482300
33
scripts/pdf/build-pdf.sh
Normal file
33
scripts/pdf/build-pdf.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/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
|
Reference in New Issue
Block a user