diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.ts index 6e8aefb61..c1ce8c4bc 100644 --- a/src/services/in_app_help.ts +++ b/src/services/in_app_help.ts @@ -39,14 +39,20 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt type: "doc", attributes: [] }; + let iconClass: string | undefined = undefined; // Handle attributes for (const attribute of noteMeta.attributes ?? []) { if (attribute.name === "iconClass") { - item.attributes?.push(attribute); + iconClass = attribute.value; } } + // Handle folder notes + if (!noteMeta.dataFileName) { + iconClass = "bx bx-folder"; + } + // Handle text notes if (noteMeta.type === "text" && noteMeta.dataFileName) { const docPath = `${docNameRoot}/${path.basename(noteMeta.dataFileName, ".html")}` @@ -58,6 +64,7 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt }); } + // Handle children if (noteMeta.children) { const children: HiddenSubtreeItem[] = []; for (const childMeta of noteMeta.children) { @@ -68,5 +75,14 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt item.children = children; } + // Handle note icon + if (iconClass) { + item.attributes?.push({ + name: "iconClass", + value: iconClass, + type: "label" + }); + } + return item; }