-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·430 lines (430 loc) · 16.7 KB
/
build.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
#!/bin/bash
echo build sermon project $1
if [ "$1" == "" ] ; then
echo "NAME "
echo " build.sh - build sermon LaTeX source, "
echo " or generate them from raw textual format files "
echo " "
echo "SYNOPSIS "
echo " build.sh [action] [optional argument] "
echo " "
echo "DESCRIPTION "
echo " The build.sh majorly executes three categories of actions. "
echo " 1st: convert textual files from whisper <srt> typical <txt>. "
echo " 2nd: generate LaTeX source files from sermon txt source files. "
echo " 3rd: compile LaTeX source files for each sermon project. "
echo " "
echo " The actions are as follows: "
echo " "
echo " genall Perform srt-to-txt transformation, sourcing from srt "
echo " files pathed under ./app/whisper/<PROJECT_NAME>. "
echo " The output txt files are pathed under "
echo " ./app/data/<PROJECT_NAME>. "
echo " This action requires the system equipped with python3."
echo " "
echo " buildall Compile the LaTeX source files of all sermon projects."
echo " Available sermon projects include: "
echo " - ACSMHK "
echo " - CBI "
echo " - CGST "
echo " - DSCCC "
echo " - FLWC "
echo " - FVC "
echo " - HKBC "
echo " - JNG "
echo " - KFC "
echo " - PORCH "
echo " - STBC "
echo " - VINE "
echo " - WWBS "
echo " - YFCX "
echo " - YOS "
echo " A common practice on every LaTeX build action in this "
echo " script is that every time the tex file is to be "
echo " compiled twice, in order to get LaTeX toc files to "
echo " converge. An explicit option 'once' could be provided "
echo " if the second compilation is intended to be skipped. "
echo " "
echo " ACSMHK Compile ACSMHK sermon book. "
echo " ACSMHK := Alliance Communications Ministry "
echo " 宣道傳意及出版事工 "
echo " "
echo " CBI Compile CBI sermon book. "
echo " CBI := Chinese Bible International "
echo " 漢語聖經協會 "
echo " "
echo " CGST Compile CGST sermon book. "
echo " CGST := China Graduate School of Theology "
echo " 中國神學研究院 "
echo " "
echo " DSCCC Compile DSCCC sermon book. "
echo " DSCCC := Divinity School of Chung Chi College, CUHK "
echo " 香港中文大學崇基學院神學院 "
echo " "
echo " FLWC Compile FLWC sermon book. "
echo " FLWC := Flow Church "
echo " 流堂 "
echo " "
echo " FVC Compile FVC sermon book. "
echo " FVC := Fairview Church "
echo " 宣道會錦繡堂 "
echo " "
echo " HKBC Compile HKBC sermon book. "
echo " HKBC := Hong Kong Bible Conference "
echo " 港九培靈研經會 "
echo " "
echo " JNG Compile JNG sermon book. "
echo " JNG := Channel of Johnson Ng "
echo " Johnson Ng 我愛聽主道 "
echo " "
echo " KFC Compile KFC sermon book. "
echo " KFC := EFCC Kong Fok Church "
echo " 播道會港福堂 "
echo " "
echo " PORCH Compile PORCH sermon book. "
echo " PORCH := The Porch, LBJFWY 7540, Dallas, TX 75251 "
echo " Podcast of Tuesday night in Watermark Community Church"
echo " "
echo " STBC Compile STBC sermon book. "
echo " STBC := Shatin Baptist Church "
echo " 沙田浸信會 "
echo " "
echo " VINE Compile VINE sermon book. "
echo " VINE := The Vine Church (HK | YL) "
echo " Vine Church located at WanChai | YuenLong "
echo " "
echo " WWBS Compile WWBS sermon book. "
echo " WWBS := Worldwide Bible Society "
echo " 環球聖經公會 "
echo " "
echo " YFCX Compile YFCX sermon book. "
echo " YFCX := Yan Fook Church & Yan Fook Church Youth "
echo " 播道會恩福堂 & 播道會恩福堂青年團 "
echo " "
echo " YOS Compile YOS sermon book. "
echo " YOS := yau Oi School "
echo " 中華宣道會友愛堂信培部 "
echo " "
echo " The optional arguments are as follows: "
echo " "
echo " once The explicit option used in 'buildall' or any "
echo " individual '<PROJECT_NAME>' so that the tex source "
echo " compilation only executes once. "
echo " This option does not take effect with 'genall' "
fi
if [ "$1" == "genall" ] ; then
cd ../whisper
python3 convert_srt2txt.py ACSMHK
python3 convert_srt2txt.py CBI
python3 convert_srt2txt.py CGST
python3 convert_srt2txt.py FLWC
python3 convert_srt2txt.py FVC
python3 convert_srt2txt.py JNG
python3 convert_srt2txt.py KFC
python3 convert_srt2txt.py PORCH
python3 convert_srt2txt.py STBC
python3 convert_srt2txt.py VINE
python3 convert_srt2txt.py WWBS
python3 convert_srt2txt.py YFCX
python3 convert_srt2txt.py YOS
cd ../projects
cd ./ACSMHK
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./CBI
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./CGST
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./DSCCC
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./FLWC
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./FVC
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./HKBC
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./JNG
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./KFC
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./PORCH
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./STBC
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./VINE
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./WWBS
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./YFCX
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ./YOS
python3 ../func_ipynb_2_py.py generate_sermonbook.ipynb
python3 generate_sermonbook.py
cd ..
cd ../build
elif [ "$1" == "buildall" ] ; then
if [ "$2" != "once" ] ; then
./build.sh ACSMHK
./build.sh CBI
./build.sh CGST
./build.sh DSCCC
./build.sh FLWC
./build.sh FVC
./build.sh HKBC
./build.sh JNG
./build.sh KFC
./build.sh PORCH
./build.sh STBC
./build.sh VINE
./build.sh WWBS
./build.sh YFCX
./build.sh YOS
else
./build.sh ACSMHK once
./build.sh CBI once
./build.sh CGST once
./build.sh DSCCC once
./build.sh FLWC once
./build.sh FVC once
./build.sh HKBC once
./build.sh JNG once
./build.sh KFC once
./build.sh PORCH once
./build.sh STBC once
./build.sh VINE once
./build.sh WWBS once
./build.sh YFCX once
./build.sh YOS once
fi
elif [ "$1" == "ACSMHK" ] ; then
OUTFILENAME=sermon_$1
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "CBI" ] ; then
OUTFILENAME=sermon_$1
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "CGST" ] ; then
OUTFILENAME=sermon_$1
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "DSCCC" ] ; then
OUTFILENAME=sermon_$1_2009-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "FLWC" ] ; then
OUTFILENAME=sermon_$1_2020-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "FVC" ] ; then
OUTFILENAME=sermon_$1_2017-22
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
OUTFILENAME=sermon_$1_2023-28
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "HKBC" ] ; then
OUTFILENAME=sermon_$1_1928-2007
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
OUTFILENAME=sermon_$1_2008-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "JNG" ] ; then
OUTFILENAME=sermon_$1_2012-18
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
OUTFILENAME=sermon_$1_2019-20
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
OUTFILENAME=sermon_$1_2021-22
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
OUTFILENAME=sermon_$1_2023-24
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "KFC" ] ; then
OUTFILENAME=sermon_$1_2020-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "PORCH" ] ; then
OUTFILENAME=sermon_$1_2014-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "STBC" ] ; then
OUTFILENAME=sermon_$1_2020-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "VINE" ] ; then
OUTFILENAME=sermon_$1_2020-present
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "WWBS" ] ; then
OUTFILENAME=sermon_$1
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "YFCX" ] ; then
OUTFILENAME=sermon_$1_2020-23
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
OUTFILENAME=sermon_$1_2024-27
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
elif [ "$1" == "YOS" ] ; then
OUTFILENAME=sermon_$1
cd $1
xelatex $OUTFILENAME.tex
if [ "$2" != "once" ] ; then
xelatex $OUTFILENAME.tex
fi
rm -f $OUTFILENAME.mtc*
mv $OUTFILENAME.pdf ../../pdf/
cd ..
fi