forked from python/python-docs-pt-br
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·28 lines (19 loc) · 961 Bytes
/
build.sh
File metadata and controls
executable file
·28 lines (19 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# Build translated version of Python Docs
[ -n "$GITHUB_ACTIONS" ] && set -x
set -e
# Allow language being passed as 1st argument, defaults to pt_BR
LANGUAGE=${1:-pt_BR}
ROOTDIR="$(dirname $0)/.."
cd ${ROOTDIR}
test -f cpython/Doc/conf.py || ( echo Unable to find proper CPython Doc folder; exit 1; )
pofiles=$(find . -maxdepth 2 -name '*.po' | sort -u)
for po in ${pofiles}; do
install -Dm644 ${po} "cpython/Doc/locales/${LANGUAGE}/LC_MESSAGES/${po}"
done
sphinx-build -b html -d build/doctrees -q --keep-going -jauto -D locale_dirs=locales -D language=pt_BR -D gettext_compact=0 -D latex_engine=xelatex -D latex_elements.inputenc= -D latex_elements.fontenc= -W cpython/Doc cpython/Doc/build/html
if [ -z "$GITHUB_ACTIONS" ]; then
echo "See file:/$(realpath ${ROOTDIR})/cpython/Doc/build/html/index.html"
echo "or serve it in http://localhost:8080 by running:"
echo "python3 cpython/Tools/scripts/serve.py cpython/Doc/build/html"
fi