File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -28,13 +28,26 @@ def fetch_contributors():
2828
2929# ---------- Fetch README content ----------
3030def fetch_readme_excerpt (lines = 5 ):
31- """Return the first `lines` lines from README.md (preserves empty lines )."""
31+ """Return first `lines` lines from README.md (skipping initial heading )."""
3232 url = f"https://raw.githubusercontent.com/{ ORG } /{ REPO } /master/README.md"
3333 r = requests .get (url )
3434 if r .status_code != 200 :
3535 return ""
36- content = r .text .splitlines () # no .strip(): keep leading/trailing blanks as they are
37- return "\n " .join (content [:lines ])
36+
37+ all_lines = r .text .splitlines ()
38+
39+ # Skip the first heading line (starts with '#')
40+ filtered = []
41+ heading_skipped = False
42+ for line in all_lines :
43+ if not heading_skipped and line .strip ().startswith ("#" ):
44+ heading_skipped = True
45+ continue
46+ filtered .append (line )
47+ if len (filtered ) >= lines :
48+ break
49+
50+ return "\n " .join (filtered )
3851
3952# ---------- Write output markdown ----------
4053def write_markdown (info , authors , readme_snippet = "" ):
You can’t perform that action at this time.
0 commit comments