-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_index.py
More file actions
32 lines (26 loc) · 872 Bytes
/
generate_index.py
File metadata and controls
32 lines (26 loc) · 872 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
29
30
31
32
import glob
import os
# Generate index.html in root listing all .whl files
html_content = """<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IfcOpenShell Pyodide Wheels</title>
</head>
<body>
<h1>Available IfcOpenShell Pyodide Wheels</h1>
<p><a href="https://github.com/IfcOpenShell/wasm-wheels#pyodide-test-wheels">See README for details</a></p>
<ul>
"""
# Find all .whl files in the repo, sorted descending
whl_files = sorted(glob.glob("**/*.whl", recursive=True), reverse=True)
for whl_file in whl_files:
filename = os.path.basename(whl_file)
# Since index.html is in root, link to filename
html_content += f' <li><a href="{filename}">{filename}</a></li>\n'
html_content += """ </ul>
</body>
</html>
"""
print(html_content)