From 2af324c3020697d7be36048ede1252fa9d6c98fa Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 25 Oct 2022 12:29:55 +0200 Subject: [PATCH] Improve genPluginList --- scripts/genPluginList.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/scripts/genPluginList.js b/scripts/genPluginList.js index 20cf9d02..909ee406 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 +/// + (() => { - // eslint-disable-next-line spaced-comment - /// /** * @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"); })();