Skip to content

Commit

Permalink
Update as of 8 December 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellDash332 committed Dec 8, 2024
1 parent e1f0e1a commit fad329b
Show file tree
Hide file tree
Showing 23 changed files with 3,030 additions and 866 deletions.
923 changes: 509 additions & 414 deletions README.md

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Image credits to https://languages.abranhe.com/
image_mapper = {
'py': 'python',
'sh': 'bash',
'c': 'c',
'cpp': 'cpp',
'cs': 'csharp',
Expand Down Expand Up @@ -63,7 +64,7 @@

readme_image_links = set()
html_image_links = set()
has_py = has_cpp = False; has_java = []
has_py = has_cpp = has_sh = False; has_java = []
for file in sorted(files):
ext = file.split('.')[-1]
if ext in image_mapper and file not in file_whitelist:
Expand All @@ -77,6 +78,8 @@
has_cpp = file
if not has_java and ext == 'java':
has_java.append(file.lower())
if not has_sh and ext == 'sh':
has_sh = file
if not has_py and file not in file_whitelist and ext == 'py':
has_py = file
has_java = min(has_java) if has_java else []
Expand All @@ -85,11 +88,11 @@

# Handle special cases
if path in pid_force_mapper:
has_py = has_cpp = has_java = pid_force_mapper[path]
has_py = has_cpp = has_java = has_sh = pid_force_mapper[path]

# Another split to handle variants like /autori
pid = (has_py or has_cpp or has_java).split('.')[0].split('-')[0]
pid = (has_py or has_cpp or has_java or has_sh).split('.')[0].split('-')[0]

if nus:
url = f"https://nus.kattis.com/problems/{pid}"
nus_readme_contents.append([pid, f"|[{path}]({url})| {pid} |{''.join(readme_image_links).replace(' ','%20')}|\n"])
Expand Down
Loading

0 comments on commit fad329b

Please sign in to comment.