Skip to content

Commit

Permalink
Update sort method
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlGao4 committed Aug 19, 2024
1 parent dab469b commit b7d9706
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gh-actions-generate-toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def human_readable_size(size):
markdown += f"### {catagory}\n\n"
for name in sorted(release_files[catagory].keys()):
markdown += f"#### {name}\n"
for asset in sorted(release_files[catagory][name], key=lambda x: tuple(reversed(x.rsplit(".", 1)))):
for asset in sorted(release_files[catagory][name], key=lambda x: tuple(reversed(re.match(r"(.*?(\.[^ ]+))", x).groups()))):
asset_name = asset.replace("\\_", "_").replace("\\[", "[").replace("\\]", "]").replace("\\\\", "\\")
markdown += f"<details><summary>{asset_name}</summary>\n\n"
if (catagory, name, asset) in descriptions:
Expand All @@ -128,7 +128,7 @@ def human_readable_size(size):
markdown += f"#### [{name}]({instrument_urls[catagory][name]})\n"
else:
markdown += f"#### {name}\n"
for asset in sorted(instruments[catagory][name].keys(), key=lambda x: tuple(reversed(x.rsplit(".", 1)))):
for asset in sorted(instruments[catagory][name].keys(), key=lambda x: tuple(reversed(re.match(r"(.*?(\.[^ ]+))", x).groups()))):
asset_name = asset.replace("\\_", "_").replace("\\[", "[").replace("\\]", "]").replace("\\\\", "\\")
markdown += f"<details><summary>{asset_name}</summary>\n\n"
if (catagory, name, asset) in descriptions:
Expand Down

0 comments on commit b7d9706

Please sign in to comment.