From 0a1a63c231134200cb082750d6998da9b6b36aa3 Mon Sep 17 00:00:00 2001 From: Ashley Graves Date: Sat, 27 Jul 2024 15:43:27 +0200 Subject: [PATCH] test --- .forgejo/scripts/update-wiki.py | 34 ++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.forgejo/scripts/update-wiki.py b/.forgejo/scripts/update-wiki.py index ee0fea7..aa00922 100644 --- a/.forgejo/scripts/update-wiki.py +++ b/.forgejo/scripts/update-wiki.py @@ -12,27 +12,35 @@ mods = dict() for mod in glob.glob("pack/mods/*.toml"): with open(mod, "r") as f: data = tomli.load(f) - url = "" - - # there has to be a better way to do this + moddata = dict() + moddata["url"] = "" if "modrinth" in data["update"]: - url = "https://modrinth.com/mod/" + data["update"]["modrinth"]["mod-id"] + moddata["url"] = "https://modrinth.com/mod/" + data["update"]["modrinth"]["mod-id"] + moddata["site"] = "Modrinth" elif "curseforge" in data["update"]: - url = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"]) + moddata["url"] = "https://legacy.curseforge.com/projects/" + str(data["update"]["curseforge"]["project-id"]) + moddata["site"] = "CurseForge" - moddata = dict() moddata["side"] = data["side"] - moddata["url"] = url mods[data["name"]] = moddata with open("wiki/Modlist.md", "w") as f: - for mod in mods: - if mods[mod]["url"] != "": - f.write("- [" + mod + "](" + mods[mod]["url"] + ")") - else: - f.write("- " + mod) + f.write("") + f.write("\r\n") + f.write("") + f.write("") + f.write("") + f.write("\r\n") - f.write(" (" + mods[mod]["side"] + ")\r\n") + for mod in mods: + f.write("\r\n") + f.write("") + f.write("") + if mods[mod]["url"] != "": + f.write("") + else: + f.write("") + f.write("\r\n")
NameSideLink
" + mod + "" + mods[mod]["side"] + "" + moddata[mod]["host"] + "N/A