diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-25 12:29:55 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-25 12:29:55 +0200 |
commit | 2af324c3020697d7be36048ede1252fa9d6c98fa (patch) | |
tree | 30b48e68504cd265bb80e8aad6f98ecb0412ac88 /scripts | |
parent | 4bddcee40bdc669f28a80543d58a238f92915bbb (diff) | |
download | Vencord-2af324c3020697d7be36048ede1252fa9d6c98fa.tar.gz Vencord-2af324c3020697d7be36048ede1252fa9d6c98fa.tar.bz2 Vencord-2af324c3020697d7be36048ede1252fa9d6c98fa.zip |
Improve genPluginList
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/genPluginList.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/genPluginList.js b/scripts/genPluginList.js index 20cf9d0..909ee40 100644 --- a/scripts/genPluginList.js +++ b/scripts/genPluginList.js @@ -20,9 +20,10 @@ // Just copy paste the entire file into a running Vencord install and it will prompt you // to save the file +// eslint-disable-next-line spaced-comment +/// <reference types="../src/modules"/> + (() => { - // eslint-disable-next-line spaced-comment - /// <reference types="../src/modules"/> /** * @type {typeof import("~plugins").default} */ @@ -39,7 +40,7 @@ let list = "\n\n"; for (const p of Object.values(Plugins).sort((a, b) => a.name.localeCompare(b.name))) { - tableOfContents += `- [${p.name}](#${encodeURIComponent(p.name)})\n`; + tableOfContents += `- [${p.name}](#${p.name.replaceAll(" ", "-")})\n`; list += `## ${p.name} @@ -49,7 +50,7 @@ ${p.description} `; if (p.commands?.length) { - list += "\n\n### Commands\n"; + list += "\n\n#### Commands\n"; for (const cmd of p.commands) { list += `${cmd.name} - ${cmd.description}\n\n`; } @@ -57,9 +58,6 @@ ${p.description} list += "\n\n"; } - const data = new Blob([header.trimStart(), tableOfContents, list.trimEnd()], { type: "text/plain" }); - data.arrayBuffer().then(buf => - DiscordNative.fileManager.saveWithDialog(new Uint8Array(buf), "plugins.md") - ); - + const data = new TextEncoder().encode(header + tableOfContents + list); + DiscordNative.fileManager.saveWithDialog(data, "plugins.md"); })(); |