From 62ab6fee6697de6515070a18cb3cfc0d6f4a8d4e Mon Sep 17 00:00:00 2001 From: Sammy Hori Date: Fri, 13 Dec 2024 18:04:27 +0000 Subject: [PATCH 1/3] Clean up README edit warning message --- .github/README-template.j2 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/README-template.j2 b/.github/README-template.j2 index eecc4f05..ed859d51 100644 --- a/.github/README-template.j2 +++ b/.github/README-template.j2 @@ -1,7 +1,7 @@ - - - - + + + + # Awesome First PR Opportunities [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) From 5d353dea8918749845befacdedded73d4f74ce6d Mon Sep 17 00:00:00 2001 From: Sammy Hori Date: Fri, 13 Dec 2024 20:42:45 +0000 Subject: [PATCH 2/3] Reduced the table of contents length by putting it into a table Categories are grouped by their first character in the table --- .github/README-template.j2 | 7 +++++-- .github/scripts/render-readme.py | 12 +++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/README-template.j2 b/.github/README-template.j2 index ed859d51..981c45d0 100644 --- a/.github/README-template.j2 +++ b/.github/README-template.j2 @@ -11,9 +11,12 @@ If you are a maintainer of open-source projects, add the label `first-timers-onl If you are not a programmer but would like to contribute, check out the [Awesome for non-programmers](https://github.com/szabgab/awesome-for-non-programmers) list. + ## Table of Contents: -{% for category in categories %} -- [{{ category.title }}](#{{ category.link_id }}){% endfor %} + +||Languages| +|--|--|{% for category_group, categories in category_groups.items() %} +|{{ category_group }}|{% for category in categories %}[{{ category.title }}](#{{ category.link_id }}){% if loop.index < (categories | length) %}, {% endif %}{% endfor %}|{% endfor %} {% for category in categories %} ## {{ category.title }} {% for entry in category.entries %} diff --git a/.github/scripts/render-readme.py b/.github/scripts/render-readme.py index ce88f704..d109ca47 100755 --- a/.github/scripts/render-readme.py +++ b/.github/scripts/render-readme.py @@ -6,11 +6,9 @@ TEMPLATEFILE = "README-template.j2" TARGETFILE = "./README.md" - def new_technology_dict(repo_technology): return {"link_id": repo_technology.lower(), "entries": []} - technologies = {} with open(DATAFILE, "r") as datafile: @@ -39,11 +37,19 @@ def new_technology_dict(repo_technology): ) categories = sorted(categories, key=lambda x: x["title"].upper()) +category_groups = {"Misc": []} for category in categories: category["entries"] = sorted(category["entries"], key=lambda x: x["name"].upper()) + first_char = category["title"][0].upper() + if first_char in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": + if first_char not in category_groups: + category_groups[first_char] = [] + category_groups[first_char].append(category) + else: + category_groups["Misc"].append(category) sponsors = data["sponsors"] -output = template.render(categories=categories, sponsors=sponsors) +output = template.render(category_groups=category_groups, categories=categories, sponsors=sponsors) open(TARGETFILE, "w").write(output) From 2a94ab4dec6dc03d169416c36c23915395fc918c Mon Sep 17 00:00:00 2001 From: Sammy Hori Date: Fri, 13 Dec 2024 20:59:23 +0000 Subject: [PATCH 3/3] Remove stray newline from README template --- .github/README-template.j2 | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/README-template.j2 b/.github/README-template.j2 index 981c45d0..7b626e96 100644 --- a/.github/README-template.j2 +++ b/.github/README-template.j2 @@ -10,8 +10,6 @@ Inspired by [First Timers Only](https://kentcdodds.com/blog/first-timers-only) b If you are a maintainer of open-source projects, add the label `first-timers-only` (or similar) to your project and list it here so that people can find it. If you are not a programmer but would like to contribute, check out the [Awesome for non-programmers](https://github.com/szabgab/awesome-for-non-programmers) list. - - ## Table of Contents: ||Languages|