refactor: simplify readme contributor section to avatars only

This commit is contained in:
Abdessamad Derraz
2026-04-02 15:39:34 +02:00
parent 812775f6b4
commit f9a612db4a
2 changed files with 6 additions and 51 deletions

View File

@@ -118,8 +118,8 @@ To keep packs accurate, each file is checked against the emulator's source code.
## Contributors
<a href="https://github.com/PixNyb"><img src="https://avatars.githubusercontent.com/u/40770831?v=4" width="50" title="PixNyb"></a> RomM [#37](https://github.com/Abdess/retrobios/pull/37)
<a href="https://github.com/monster-penguin"><img src="https://avatars.githubusercontent.com/u/266009589?v=4" width="50" title="monster-penguin"></a> RetroDECK [#36](https://github.com/Abdess/retrobios/pull/36)
<a href="https://github.com/PixNyb"><img src="https://avatars.githubusercontent.com/u/40770831?v=4" width="50" title="PixNyb"></a>
<a href="https://github.com/monster-penguin"><img src="https://avatars.githubusercontent.com/u/266009589?v=4" width="50" title="monster-penguin"></a>
## Contributing
@@ -130,4 +130,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
This repository provides BIOS files for personal backup and archival purposes.
*Auto-generated on 2026-04-02T13:28:54Z*
*Auto-generated on 2026-04-02T13:38:26Z*

View File

@@ -93,20 +93,6 @@ def fetch_contributors() -> list[dict]:
return []
def _build_contributor_map(registry: dict) -> dict[str, list[dict]]:
"""Map GitHub username to list of {platform, contribution, pr}."""
result: dict[str, list[dict]] = {}
for platform_name, entry in registry.items():
for c in entry.get("contributed_by", []):
username = c["username"]
result.setdefault(username, []).append({
"platform": platform_name,
"contribution": c.get("contribution", ""),
"pr": c.get("pr"),
})
return result
def generate_readme(db: dict, platforms_dir: str) -> str:
total_files = db.get("total_files", 0)
total_size = db.get("total_size", 0)
@@ -115,13 +101,6 @@ def generate_readme(db: dict, platforms_dir: str) -> str:
platform_names = list_registered_platforms(platforms_dir, include_archived=True)
registry_path = Path(platforms_dir) / "_registry.yml"
registry = {}
if registry_path.exists():
import yaml
with open(registry_path) as f:
registry = (yaml.safe_load(f) or {}).get("platforms", {})
from common import load_data_dir_registry
from cross_reference import _build_supplemental_index
@@ -353,43 +332,19 @@ def generate_readme(db: dict, platforms_dir: str) -> str:
contributors = fetch_contributors()
if contributors:
contributor_map = _build_contributor_map(registry)
lines.extend(
[
"## Contributors",
"",
]
)
platform_display: dict[str, str] = {}
for name, cov in coverages.items():
platform_display[name] = cov["platform"]
for c in contributors:
login = c["login"]
avatar = c.get("avatar_url", "")
url = c.get("html_url", f"https://github.com/{login}")
contributions = contributor_map.get(login, [])
if contributions:
parts = []
for contrib in contributions:
display = platform_display.get(contrib["platform"], contrib["platform"])
pr = contrib.get("pr")
label = display
if pr:
label += f" [#{pr}](https://github.com/Abdess/retrobios/pull/{pr})"
parts.append(label)
desc = ", ".join(parts)
else:
desc = ""
line = f'<a href="{url}"><img src="{avatar}" width="50" title="{login}"></a>'
if desc:
line += f" {desc}"
lines.append(line)
lines.append(
f'<a href="{url}"><img src="{avatar}" width="50" title="{login}"></a>'
)
lines.append("")
lines.extend(