Skip to content

Commit

Permalink
feat: add talb of contens in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
OnFireByte committed Aug 15, 2023
1 parent 513b452 commit 2c67fb5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Awesome Stack!
## Contents

1. [Backend](#Backend)
2. [Devops](#Devops)
3. [Discord](#Discord)
4. [Framework](#Framework)
5. [Frontend](#Frontend)
6. [Git](#Git)
7. [IDE](#IDE)
8. [VIM](#VIM)
## Backend

- [discord.js](https://discord.js.org/)
Expand Down
9 changes: 9 additions & 0 deletions script/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ let mdString = fs.readFileSync("./script/template/readme-header.md", "utf-8");

const tagGroup = Array.from(tagMap).sort(cmp((v) => v[0].toLowerCase()));

// add table of contents
mdString += `## Contents\n\n`;

tagGroup.forEach(([tag], index) => {
tag = tag[0].toUpperCase() + tag.slice(1);
mdString += `${index + 1}. [${tag}](#${tag})\n`;
});

// add packages list
for (let [tag, items] of tagGroup) {
tag = tag[0].toUpperCase() + tag.slice(1);
mdString += `## ${tag}\n\n`;
Expand Down

0 comments on commit 2c67fb5

Please sign in to comment.