Skip to content

Commit 2cd1f33

Browse files
author
Sreeparna Deb
committed
added README content after metadata
1 parent a6cc18d commit 2cd1f33

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

scripts/update_plugininfo.py

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,19 @@ def fetch_contributors():
3030

3131

3232
# ---------- Fetch README content ----------
33-
def fetch_readme_excerpt(max_lines=5):
34-
"""
35-
Fetch the README content and return the first few non-empty lines as a string.
36-
Falls back gracefully if README not found.
37-
"""
33+
def fetch_readme_excerpt(lines=5):
34+
"""Fetch first few lines from README.md"""
3835
url = f"https://raw.githubusercontent.com/{ORG}/{REPO}/master/README.md"
3936
r = requests.get(url)
4037
if r.status_code != 200:
41-
print("⚠️ No README.md found or couldn't fetch it.")
42-
return None
43-
44-
lines = r.text.splitlines()
45-
excerpt = []
46-
for line in lines:
47-
clean = line.strip()
48-
if clean: # skip empty lines
49-
excerpt.append(clean)
50-
if len(excerpt) >= max_lines:
51-
break
52-
53-
if not excerpt:
54-
return None
55-
return " ".join(excerpt)
38+
return ""
39+
content = r.text.strip().splitlines()
40+
snippet = "\n".join(content[:lines])
41+
return snippet
5642

5743
# ---------- Write output markdown ----------
5844
def write_markdown(info, authors, longdescription=None):
59-
readme_snippet = fetch_readme_excerpt(max_lines=5)
45+
readme_snippet = fetch_readme_excerpt(lines=5)
6046

6147
metadata = {
6248
"layout": "plugin",

0 commit comments

Comments
 (0)