mirror of
https://github.com/MunGell/awesome-for-beginners.git
synced 2026-01-24 04:19:06 -08:00
Reduced the table of contents length by putting it into a table
Categories are grouped by their first character in the table
This commit is contained in:
7
.github/README-template.j2
vendored
7
.github/README-template.j2
vendored
@@ -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.
|
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:
|
## 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 %}
|
{% for category in categories %}
|
||||||
## {{ category.title }}
|
## {{ category.title }}
|
||||||
{% for entry in category.entries %}
|
{% for entry in category.entries %}
|
||||||
|
|||||||
12
.github/scripts/render-readme.py
vendored
12
.github/scripts/render-readme.py
vendored
@@ -6,11 +6,9 @@ TEMPLATEPATH = "./.github/"
|
|||||||
TEMPLATEFILE = "README-template.j2"
|
TEMPLATEFILE = "README-template.j2"
|
||||||
TARGETFILE = "./README.md"
|
TARGETFILE = "./README.md"
|
||||||
|
|
||||||
|
|
||||||
def new_technology_dict(repo_technology):
|
def new_technology_dict(repo_technology):
|
||||||
return {"link_id": repo_technology.lower(), "entries": []}
|
return {"link_id": repo_technology.lower(), "entries": []}
|
||||||
|
|
||||||
|
|
||||||
technologies = {}
|
technologies = {}
|
||||||
|
|
||||||
with open(DATAFILE, "r") as datafile:
|
with open(DATAFILE, "r") as datafile:
|
||||||
@@ -39,11 +37,19 @@ for key, value in zip(technologies.keys(), technologies.values()):
|
|||||||
)
|
)
|
||||||
|
|
||||||
categories = sorted(categories, key=lambda x: x["title"].upper())
|
categories = sorted(categories, key=lambda x: x["title"].upper())
|
||||||
|
category_groups = {"Misc": []}
|
||||||
for category in categories:
|
for category in categories:
|
||||||
category["entries"] = sorted(category["entries"], key=lambda x: x["name"].upper())
|
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"]
|
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)
|
open(TARGETFILE, "w").write(output)
|
||||||
|
|||||||
Reference in New Issue
Block a user