Skip to content

Commit 13bb4a0

Browse files
committed
Process all HTML files
1 parent d616447 commit 13bb4a0

File tree

1 file changed

+23
-14
lines changed

1 file changed

+23
-14
lines changed

docs/scripts/post-render.py

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,26 @@
1010
site_files = os.listdir("_site")
1111
print("Files in '_site' directory:", site_files)
1212

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

Comments
 (0)