mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-04-13 12:22:33 -05:00
refactor: simplify readme contributor section to avatars only
This commit is contained in:
@@ -118,8 +118,8 @@ To keep packs accurate, each file is checked against the emulator's source code.
|
|||||||
|
|
||||||
## Contributors
|
## 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/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> RetroDECK [#36](https://github.com/Abdess/retrobios/pull/36)
|
<a href="https://github.com/monster-penguin"><img src="https://avatars.githubusercontent.com/u/266009589?v=4" width="50" title="monster-penguin"></a>
|
||||||
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
@@ -130,4 +130,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|||||||
|
|
||||||
This repository provides BIOS files for personal backup and archival purposes.
|
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*
|
||||||
|
|||||||
@@ -93,20 +93,6 @@ def fetch_contributors() -> list[dict]:
|
|||||||
return []
|
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:
|
def generate_readme(db: dict, platforms_dir: str) -> str:
|
||||||
total_files = db.get("total_files", 0)
|
total_files = db.get("total_files", 0)
|
||||||
total_size = db.get("total_size", 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)
|
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 common import load_data_dir_registry
|
||||||
from cross_reference import _build_supplemental_index
|
from cross_reference import _build_supplemental_index
|
||||||
|
|
||||||
@@ -353,43 +332,19 @@ def generate_readme(db: dict, platforms_dir: str) -> str:
|
|||||||
|
|
||||||
contributors = fetch_contributors()
|
contributors = fetch_contributors()
|
||||||
if contributors:
|
if contributors:
|
||||||
contributor_map = _build_contributor_map(registry)
|
|
||||||
|
|
||||||
lines.extend(
|
lines.extend(
|
||||||
[
|
[
|
||||||
"## Contributors",
|
"## Contributors",
|
||||||
"",
|
"",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
platform_display: dict[str, str] = {}
|
|
||||||
for name, cov in coverages.items():
|
|
||||||
platform_display[name] = cov["platform"]
|
|
||||||
|
|
||||||
for c in contributors:
|
for c in contributors:
|
||||||
login = c["login"]
|
login = c["login"]
|
||||||
avatar = c.get("avatar_url", "")
|
avatar = c.get("avatar_url", "")
|
||||||
url = c.get("html_url", f"https://github.com/{login}")
|
url = c.get("html_url", f"https://github.com/{login}")
|
||||||
|
lines.append(
|
||||||
contributions = contributor_map.get(login, [])
|
f'<a href="{url}"><img src="{avatar}" width="50" title="{login}"></a>'
|
||||||
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("")
|
lines.append("")
|
||||||
|
|
||||||
lines.extend(
|
lines.extend(
|
||||||
|
|||||||
Reference in New Issue
Block a user