This commit is contained in:
Lilith Ashley Nyx Arson 🔥 2024-09-30 21:17:11 +02:00
parent 7d155d6539
commit d1ed8b2a9e
3 changed files with 27 additions and 16 deletions

View file

@ -48,6 +48,10 @@ for mod in glob.glob("pack/mods/*.toml"):
mods[moddata["name"]] = moddata
with open("wiki/Modlist.md", "w") as f:
if (count["server"] + count["client"] + count["both"]) == 0:
f.write("## No mods.")
return
f.write("## Total Count\r\n")
f.write("<table>")
f.write("\r\n<tr>")
@ -60,20 +64,23 @@ with open("wiki/Modlist.md", "w") as f:
f.write("<td>" + str(count["server"] + count["client"] + count["both"]) + "</td>")
f.write("</tr>\r\n")
f.write("<tr>")
f.write("<td>Shared</td>")
f.write("<td>" + str(count["both"]) + "</td>")
f.write("</tr>\r\n")
if count["both"] > 0:
f.write("<tr>")
f.write("<td>Shared</td>")
f.write("<td>" + str(count["both"]) + "</td>")
f.write("</tr>\r\n")
f.write("<tr>")
f.write("<td>Client</td>")
f.write("<td>" + str(count["client"]) + "</td>")
f.write("</tr>\r\n")
if count["client"] > 0:
f.write("<tr>")
f.write("<td>Client</td>")
f.write("<td>" + str(count["client"]) + "</td>")
f.write("</tr>\r\n")
f.write("<tr>")
f.write("<td>Server</td>")
f.write("<td>" + str(count["server"]) + "</td>")
f.write("</tr>\r\n")
if count["server"] > 0:
f.write("<tr>")
f.write("<td>Server</td>")
f.write("<td>" + str(count["server"]) + "</td>")
f.write("</tr>\r\n")
f.write("</table>\r\n\r\n")
@ -98,6 +105,10 @@ with open("wiki/Modlist.md", "w") as f:
f.write("\r\n</table>")
with open("wiki/Licenses.md", "w") as f:
if (count["server"] + count["client"] + count["both"]) == 0:
f.write("## No mods.")
return
for mod in mods:
data = mods[mod]
f.write("## " + mod + "\r\n")
@ -120,8 +131,8 @@ with open("wiki/Licenses.md", "w") as f:
f.write("Unknown")
f.write("</b>\r\n")
if not os.path.exists("cache"):
os.makedirs("cache")
if not os.path.exists("cache"):
os.makedirs("cache")
with open("cache/licenses.json", "w") as f:
json.dump(cache, f)

View file

@ -2,7 +2,7 @@ hash-format = "sha256"
[[files]]
file = ".forgejo/scripts/update-wiki.py"
hash = "a2537719ef5fe405d7f84a2a2cd05b9892859d9b9f8cb1ecfcdbe07d49bc988d"
hash = "d295be0209e7643f7805cce1b58a86f94438b8118c0f8e064f689f8a272c5c73"
[[files]]
file = ".forgejo/workflows/update-wiki.yaml"

View file

@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
hash-format = "sha256"
hash = "4d96fbb102e635b421e1217dfa5380c8c7d0b9a3c78737d626428e24d2ff7ac3"
hash = "bc5b1227f54e2138c594347a66ca53950c13611b07c86c06698fcb1baa5d3e8b"
[versions]
fabric = "0.16.5"