|
10 | 10 | site_files = os.listdir("_site") |
11 | 11 | print("Files in '_site' directory:", site_files) |
12 | 12 |
|
13 | | -with open("_site/reference/Actions.html", "r") as file: |
14 | | - content = file.readlines() |
15 | | - |
16 | | -# Replace <h1> tag with a styled version |
17 | | -content = [ |
18 | | - line.replace( |
19 | | - '<h1 class="title">Actions</h1>', |
20 | | - "<h1 class=\"title\" style=\"font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\">Actions</h1>", |
21 | | - ) |
22 | | - for line in content |
23 | | -] |
24 | | - |
25 | | -with open("_site/reference/Actions.html", "w") as file: |
26 | | - file.writelines(content) |
| 13 | +# Process all HTML files in the _site/reference/ directory |
| 14 | +html_files = glob.glob("_site/reference/*.html") |
| 15 | +print(f"Found {len(html_files)} HTML files to process") |
| 16 | + |
| 17 | +for html_file in html_files: |
| 18 | + print(f"Processing: {html_file}") |
| 19 | + |
| 20 | + with open(html_file, "r") as file: |
| 21 | + content = file.readlines() |
| 22 | + |
| 23 | + # Replace <h1> tag with a styled version |
| 24 | + content = [ |
| 25 | + line.replace( |
| 26 | + '<h1 class="title">', |
| 27 | + "<h1 class=\"title\" style=\"font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;\">", |
| 28 | + ) |
| 29 | + for line in content |
| 30 | + ] |
| 31 | + |
| 32 | + with open(html_file, "w") as file: |
| 33 | + file.writelines(content) |
| 34 | + |
| 35 | +print("Finished processing all files") |
0 commit comments