🎨 refine(stats): rebalance summary badge styling
Ubuntu System Information / show-system-info (push) Successful in 0s
Details
Ubuntu System Information / show-system-info (push) Successful in 0s
Details
This commit is contained in:
parent
6552f8be47
commit
550e226a2b
|
|
@ -245,18 +245,21 @@ def main() -> None:
|
||||||
"代码",
|
"代码",
|
||||||
f"{args.formatted_total_code} 行",
|
f"{args.formatted_total_code} 行",
|
||||||
normalize_color(args.total_color, DEFAULT_TOTAL_COLOR),
|
normalize_color(args.total_color, DEFAULT_TOTAL_COLOR),
|
||||||
|
variant="flat",
|
||||||
)
|
)
|
||||||
write_badge(
|
write_badge(
|
||||||
output_dir / "total-files.svg",
|
output_dir / "total-files.svg",
|
||||||
"文件",
|
"文件",
|
||||||
f"{args.formatted_total_files} 个",
|
f"{args.formatted_total_files} 个",
|
||||||
normalize_color(args.files_color, DEFAULT_FILES_COLOR),
|
normalize_color(args.files_color, DEFAULT_FILES_COLOR),
|
||||||
|
variant="flat",
|
||||||
)
|
)
|
||||||
write_badge(
|
write_badge(
|
||||||
output_dir / "language-count.svg",
|
output_dir / "language-count.svg",
|
||||||
"语言",
|
"语言",
|
||||||
f"{args.language_count} 种",
|
f"{args.language_count} 种",
|
||||||
normalize_color(args.language_count_color, DEFAULT_LANGUAGE_COUNT_COLOR),
|
normalize_color(args.language_count_color, DEFAULT_LANGUAGE_COUNT_COLOR),
|
||||||
|
variant="flat",
|
||||||
)
|
)
|
||||||
|
|
||||||
for stat in languages:
|
for stat in languages:
|
||||||
|
|
@ -265,7 +268,7 @@ def main() -> None:
|
||||||
stat.display_name,
|
stat.display_name,
|
||||||
f"{stat.formatted_lines} 行",
|
f"{stat.formatted_lines} 行",
|
||||||
stat.color,
|
stat.color,
|
||||||
variant="flat",
|
variant="split",
|
||||||
)
|
)
|
||||||
|
|
||||||
readme_path.write_text(render_readme(args, languages, badge_dir_name), encoding="utf-8")
|
readme_path.write_text(render_readme(args, languages, badge_dir_name), encoding="utf-8")
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ test -f "${readme_path}" || fail "renderer should create root README.md"
|
||||||
grep -q '<svg' "${output_dir}/total-lines.svg" || fail "svg badges should contain svg markup"
|
grep -q '<svg' "${output_dir}/total-lines.svg" || fail "svg badges should contain svg markup"
|
||||||
grep -q '2,120' "${output_dir}/total-lines.svg" || fail "total-lines badge should include formatted total code"
|
grep -q '2,120' "${output_dir}/total-lines.svg" || fail "total-lines badge should include formatted total code"
|
||||||
grep -q 'Python' "${output_dir}/python-lines.svg" || fail "language badge should include display name"
|
grep -q 'Python' "${output_dir}/python-lines.svg" || fail "language badge should include display name"
|
||||||
! grep -q 'fill="#555555"' "${output_dir}/python-lines.svg" || fail "language badge should not use the heavy gray label background"
|
! grep -q 'fill="#555555"' "${output_dir}/total-lines.svg" || fail "summary badge should not use the heavy gray label background"
|
||||||
|
grep -q 'fill="#555555"' "${output_dir}/python-lines.svg" || fail "language badge should keep the split label style"
|
||||||
grep -q '\./badges/total-lines.svg' "${readme_path}" || fail "README should reference badges via relative svg paths"
|
grep -q '\./badges/total-lines.svg' "${readme_path}" || fail "README should reference badges via relative svg paths"
|
||||||
grep -q '\./badges/python-lines.svg' "${readme_path}" || fail "README should reference language badges via relative svg paths"
|
grep -q '\./badges/python-lines.svg' "${readme_path}" || fail "README should reference language badges via relative svg paths"
|
||||||
! grep -q '^!\[总代码\](\./badges/total-lines.svg)$' "${readme_path}" || fail "README should not duplicate summary badges above the table"
|
! grep -q '^!\[总代码\](\./badges/total-lines.svg)$' "${readme_path}" || fail "README should not duplicate summary badges above the table"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue