From f876977140e83303179b7c85954db10497d1e5f6 Mon Sep 17 00:00:00 2001 From: maji Date: Mon, 29 Dec 2025 21:54:12 +0700 Subject: [PATCH] mdgen add icon --- autogen/mdgen.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/autogen/mdgen.js b/autogen/mdgen.js index beb7f5a..7e2d9c6 100644 --- a/autogen/mdgen.js +++ b/autogen/mdgen.js @@ -41,6 +41,7 @@ for (const xmlFile of xmlFiles) { let mdPath = path.join(mdAPIPath, className + ".md") let mk = "" const iconPath = path.join(iconDataPath, c.Name + ".svg") + const emojiExists = fs.existsSync(iconPath) function appendLine(str) { mk += str + "\n" @@ -49,14 +50,18 @@ for (const xmlFile of xmlFiles) { appendLine("---") appendLine("title: " + c.Name) appendLine("description:") - if (fs.existsSync(iconPath)) { + if (emojiExists) { appendLine("icon: polytoria/" + c.Name) } else { appendLine("icon: polytoria/Unknown") } appendLine("---") appendLine("") - appendLine("# " + c.Name) + if (emojiExists) { + appendLine(`# :polytoria-${c.Name}: ` + c.Name) + } else { + appendLine("# " + c.Name) + } if (c.BaseType) { appendLine("")