Skip to content

Commit

Permalink
Updated reference pages
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrayb committed Sep 10, 2024
1 parent a14950f commit 7b4e05c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cbtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,34 @@ def explore_dir_and_move(home, dir):
with open(os.path.join(home, page), 'w') as file:
file.write(data)

special_rewrites = {
'vectors.html_scalars.html': 'vectors_scalars.html',
"vectors.html_scalars.js": "vectors_scalars.js"
}

for dir in ['dyn', 'sta', 'sol']:
pages = [p for p in os.listdir(os.path.join(home, dir)) if p[-5:] == '.html']
for page in pages:
print(page)
with open(os.path.join(home, os.path.join(dir, page)), 'r') as file:
data = file.read()

for wrong, correct in special_rewrites.items():
data = data.replace(wrong, correct)

with open(os.path.join(home, os.path.join(dir, page)), 'w') as file:
file.write(data)

for page in ['index.html', 'dyn.html', 'sta.html', 'sol.html']:
print(page)
with open(os.path.join(home, page), 'r') as file:
data = file.read()

for wrong, correct in special_rewrites.items():
data = data.replace(wrong, correct)

with open(os.path.join(home, page), 'w') as file:
file.write(data)



0 comments on commit 7b4e05c

Please sign in to comment.