Template
mirror of
https://github.com/MorpheApp/morphe-patches-template.git
synced 2026-12-01 00:19:34 +00:00
chore: Update readme generator to handle null version
This commit is contained in:
1 parent
27671a31d1
commit
5617e22f05
1 file changed
+10
-5
@@ -105,12 +105,17 @@ def versions_table(targets):
|
|||||||
cells = []
|
cells = []
|
||||||
for t in targets:
|
for t in targets:
|
||||||
ver = t["version"]
|
ver = t["version"]
|
||||||
|
if ver is None:
|
||||||
|
continue
|
||||||
label = f"🧪 {ver}" if t.get("isExperimental") else ver
|
label = f"🧪 {ver}" if t.get("isExperimental") else ver
|
||||||
cells.append(label)
|
cells.append(label)
|
||||||
|
|
||||||
|
if not cells:
|
||||||
|
return ""
|
||||||
|
|
||||||
header = "| " + " | ".join(cells) + " |"
|
header = "| " + " | ".join(cells) + " |"
|
||||||
sep = "| " + " | ".join(":---:" for _ in cells) + " |"
|
sep = "| " + " | ".join(":---:" for _ in cells) + " |"
|
||||||
rows = [header, sep]
|
rows = [header, sep]
|
||||||
|
|
||||||
# Optional description row — only rendered if at least one target has one
|
# Optional description row — only rendered if at least one target has one
|
||||||
descs = [(t.get("description") or "").replace("\n", "<br>") for t in targets]
|
descs = [(t.get("description") or "").replace("\n", "<br>") for t in targets]
|
||||||
@@ -140,9 +145,9 @@ def spoiler(label, count, targets, tbl, expanded=False):
|
|||||||
def build_content(expanded=False):
|
def build_content(expanded=False):
|
||||||
"""Build the full generated patches section."""
|
"""Build the full generated patches section."""
|
||||||
lines = [
|
lines = [
|
||||||
f"> **[v{ver}](https://github.com/{owner}/{repo}/releases/tag/v{ver})**"
|
f"> **[v{ver}](https://github.com/{owner}/{repo}/releases/tag/v{ver})**"
|
||||||
f" • `{branch}` • "
|
f" • `{branch}` • "
|
||||||
f"{total} patches total"
|
f"{total} patches total"
|
||||||
]
|
]
|
||||||
|
|
||||||
# One spoiler per app, in the order they appear in the JSON
|
# One spoiler per app, in the order they appear in the JSON
|
||||||
|
|||||||
Reference in new issue
Block a user