Skip to content

Commit

Permalink
chore: improve porting progress format
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Aug 3, 2024
1 parent 5e3664a commit 234769a
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions scripts/porting.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,24 @@ def progress(args):
print(_progress_badge(progress_value))
print()

print("<details>")
print("<summary>Glyphs status</summary>")
print()

for group, _ in GLYPH_GROUPS:
glyphs = groups[group]
print(f"### {group} {_progress_badge(_group_coverage(glyphs, missing_glyphs))}")
coverage_url = _progress_url(_group_coverage(glyphs, missing_glyphs))
print("<details>")
print("<summary>")
print(f"<h3>{group}</h3>&nbsp;&nbsp;<img src=\"{coverage_url}\">")
print("</summary>")
print()
for glyph in glyphs:
if glyph in missing_glyphs:
print(f"- [ ] {glyph}")
else:
print(f"- [x] {glyph}")
print()
print("</details>")
print("</details>")
print()

if args.download_url:
print()
print(f"**[Download]({args.download_url})** CI build")

@command()
Expand All @@ -100,8 +100,11 @@ def _group_coverage(glyphs: list[str], missing_glyphs: list[str]) -> list[str]:

def _progress_badge(value: float) -> str:
"""Generates progress badge"""
int_value = int(value * 100)
return f"![](https://geps.dev/progress/{int_value:.0f})"
return f"![]({_progress_url(value)})"

def _progress_url(value: float) -> str:
"""Generates progress URL"""
return f"https://geps.dev/progress/{int(value * 100):.0f}"

def _find_missing_glyphs() -> list[str]:
"""Finds missing glyphs"""
Expand Down

0 comments on commit 234769a

Please sign in to comment.