diff --git a/README.md b/README.md index 1b1646e..64948cb 100644 --- a/README.md +++ b/README.md @@ -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/) diff --git a/script/commit.js b/script/commit.js index 23914ca..2a83f21 100644 --- a/script/commit.js +++ b/script/commit.js @@ -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`;