-
-
Notifications
You must be signed in to change notification settings - Fork 773
Expand file tree
/
Copy pathmake_summary_htmls.py
More file actions
56 lines (47 loc) · 1.83 KB
/
make_summary_htmls.py
File metadata and controls
56 lines (47 loc) · 1.83 KB
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
import json
import sys
SUFFIX, LANGS_JSON, TARGET = sys.argv[1:]
LANGS = json.loads(LANGS_JSON)
for lang in LANGS:
HTML = rf"""<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Master index</title>
</head>
<body>
<h1>T2T1</h1>
<include src="T2T1-{lang}-core_device_test-master_{SUFFIX}.html"></include>
<include src="T2T1-{lang}-core_click_test-master_{SUFFIX}.html"></include>
<include src="T2T1-{lang}-core_persistence_test-master_{SUFFIX}.html"></include>
<h1>T3B1</h1>
<include src="T3B1-{lang}-core_device_test-master_{SUFFIX}.html"></include>
<include src="T3B1-{lang}-core_click_test-master_{SUFFIX}.html"></include>
<include src="T3B1-{lang}-core_persistence_test-master_{SUFFIX}.html"></include>
<h1>T3T1</h1>
<include src="T3T1-{lang}-core_device_test-master_{SUFFIX}.html"></include>
<include src="T3T1-{lang}-core_click_test-master_{SUFFIX}.html"></include>
<include src="T3T1-{lang}-core_persistence_test-master_{SUFFIX}.html"></include>
<h1>T3W1</h1>
<include src="T3W1-{lang}-core_device_test-master_{SUFFIX}.html"></include>
<include src="T3W1-{lang}-core_click_test-master_{SUFFIX}.html"></include>
<include src="T3W1-{lang}-core_persistence_test-master_{SUFFIX}.html"></include>
<script>
(() => {{
const includes = document.getElementsByTagName('include');
[].forEach.call(includes, i => {{
let filePath = i.getAttribute('src');
fetch(filePath).then(file => {{
file.text().then(content => {{
i.insertAdjacentHTML('afterend', content);
i.remove();
}});
}});
}});
}})();
</script>
</body>
</html>
"""
with open(f"{TARGET}/{lang}_{SUFFIX}.html", "w") as f:
f.write(HTML)