remove additional newline before languages list

This commit is contained in:
Mark Eaton
2026-01-10 21:59:41 -05:00
parent 57a5188196
commit 95aaf91db4
+4 -4
View File
@@ -177,14 +177,14 @@ def generate_markdown(totals: dict[str, int]) -> str:
pairs = sorted(totals.items(), key=lambda x: x[1], reverse=True)
lines = ["## 📊 Languages\n"]
lang_lines = []
for lang, nbytes in pairs:
pct = nbytes * 100 / total_bytes
bar = "" * int(pct / 2) # up to 50 chars
lines.append(f"{bar} {lang}{pct:5.1f}%")
lang_lines.append(f"{bar} {lang}{pct:5.1f}%")
# Join with backslash + newline for markdown line breaks (except after last line)
return "\\\n".join(lines)
# Join language lines with backslash + newline for markdown line breaks
return "## 📊 Languages\n" + "\\\n".join(lang_lines)
def fetch_readme(session: requests.Session) -> tuple[str, str]: