remove additional newline before languages list
This commit is contained in:
@@ -177,14 +177,14 @@ def generate_markdown(totals: dict[str, int]) -> str:
|
|||||||
|
|
||||||
pairs = sorted(totals.items(), key=lambda x: x[1], reverse=True)
|
pairs = sorted(totals.items(), key=lambda x: x[1], reverse=True)
|
||||||
|
|
||||||
lines = ["## 📊 Languages\n"]
|
lang_lines = []
|
||||||
for lang, nbytes in pairs:
|
for lang, nbytes in pairs:
|
||||||
pct = nbytes * 100 / total_bytes
|
pct = nbytes * 100 / total_bytes
|
||||||
bar = "█" * int(pct / 2) # up to 50 chars
|
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)
|
# Join language lines with backslash + newline for markdown line breaks
|
||||||
return "\\\n".join(lines)
|
return "## 📊 Languages\n" + "\\\n".join(lang_lines)
|
||||||
|
|
||||||
|
|
||||||
def fetch_readme(session: requests.Session) -> tuple[str, str]:
|
def fetch_readme(session: requests.Session) -> tuple[str, str]:
|
||||||
|
|||||||
Reference in New Issue
Block a user