Skip to content

Commit 3452b3d

Browse files
committed
fix: improve formatting in generate-readme.js
This commit enhances the readability of the generate-readme.js file by adjusting the formatting of category links and section headers. Specifically, it adds line breaks for better visual separation and modifies the rendering of GitHub icons for clarity. Changes made: - Reformatted category links for improved readability. - Removed unnecessary line breaks in section headers. - Cleaned up the GitHub icon rendering logic. No functional code changes were made.
1 parent 80c5921 commit 3452b3d

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/generate-readme.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ handlebars.registerHelper(
3030
const categoryLinks = [];
3131
categories.forEach((category) => {
3232
if (usedCategories.has(category)) {
33-
categoryLinks.push(`* [${category}](#${category.toLowerCase().replace(/\s+/g, '-')})`);
33+
categoryLinks.push(
34+
`* [${category}](#${category.toLowerCase().replace(/\s+/g, "-")})`
35+
);
3436
}
3537
});
3638

@@ -93,7 +95,7 @@ handlebars.registerHelper("render-section", function (items, options) {
9395
result += "\n";
9496
}
9597

96-
result += `###   ${category}\n\n`;
98+
result += `### ${category}\n\n`;
9799

98100
// Sort items with hot entries first, then alphabetically within each group
99101
const sortedItems = groupedItems[category].sort((a, b) => {
@@ -133,11 +135,11 @@ function renderItem(item) {
133135
const summary = item.summary || "";
134136
const detail = item.detail || "";
135137
const hotPrefix = item.hot ? "🔥 " : "";
136-
138+
137139
// Add GitHub icon link if repo exists
138-
const githubIcon = item.repo ?
139-
` <a href="${item.repo}"><img src="https://raw.githubusercontent.com/no-fluff/awesome-vibe-coding/main/src/images/github.svg" width="16" height="16" alt="GitHub" align="absmiddle" /></a>` :
140-
"";
140+
const githubIcon = item.repo
141+
? ` <a href="${item.repo}"><img src="https://raw.githubusercontent.com/no-fluff/awesome-vibe-coding/main/src/images/github.svg" width="16" height="16" alt="GitHub" align="absmiddle" /></a>`
142+
: "";
141143

142144
return `<details>
143145
<summary><strong>${hotPrefix}<a href="${url}">${item.name}</a>${githubIcon}</strong> ${summary}</summary>

0 commit comments

Comments
 (0)