forked from lvgl/docs_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.py
executable file
·33 lines (22 loc) · 915 Bytes
/
build.py
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
29
30
31
32
33
#!/usr/bin/env python
import sys
import os
langs = ['en', 'tr', 'zh-CN', 'hu', 'fr']
clean = 0
trans = 0
args = sys.argv[1:]
if len(args) == 1:
if "clean" in args: clean = 1
if "trans" in args: trans = 1
if clean:
cmd_clean = " echo 'Clean up...\n'; rm -r html xetex; "
else:
cmd_clean = ""
if trans:
os.system("cd en && ./trans_push.py && ./trans_pull.py")
cmd_pdf = " echo '------------\nBuild PDF...\n------------'; sphinx-build -b latex . xetex && cd xetex; xelatex -interaction=batchmode *.tex; xelatex -interaction=batchmode *.tex; cp -f LittlevGL.pdf ../LittlevGL.pdf; cd ..; "
cmd_html = " echo '------------\nBuild HTML...\n------------'; sphinx-build -b html . html; "
cmd_build = cmd_clean + cmd_pdf + cmd_html + " "
for lang in langs:
cmd = " echo '\n\n************\nStart " + lang + "\n************'; cd " + lang + "; " + cmd_build + " cd ..; "
os.system(cmd)