forked from TeamBasedInquiryLearning/linear-algebra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.py
29 lines (27 loc) · 923 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
import subprocess, shutil, os
from checkit.bank import Bank
print('generating assets')
subprocess.run(["pretext", "generate", "-t", "web", '--all-formats'])
print('building web')
subprocess.run(["pretext", "build", 'web', '--clean'])
# print('building instructor')
# subprocess.run(["pretext", "build", 'web-instructor', '--clean'])
print('building print')
subprocess.run(["pretext", "build", 'print', '--clean'])
print('building slides')
subprocess.run(["python", "slides/build.py"])
cwd = os.getcwd()
os.chdir(os.path.join(cwd,'exercises'))
try:
print("regenerating exercises (no diagrams)")
b = Bank()
b.write_json(regenerate=True)
print("building checkit viewer")
b.build_viewer()
try:
shutil.rmtree("../output/deploy/2023/exercises")
except FileNotFoundError:
pass
shutil.copytree("docs","../output/deploy/2023/exercises",dirs_exist_ok=True)
finally:
os.chdir(cwd)