Skip to content

Build your personal knowledge base with Trilium Notes

feat(in_app_help): support webviews

Elian Doranecb2c53c6f0a
diff --git a/src/services/in_app_help.ts b/src/services/in_app_help.ts
index 0af9116844..fffbf78124 100644
--- a/src/services/in_app_help.ts
+++ b/src/services/in_app_help.ts
@@ -44,6 +44,15 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt
for (const attribute of noteMeta.attributes ?? []) {
if (attribute.name === "iconClass") {
iconClass = attribute.value;
+ continue;
+ }
+
+ if (attribute.name === "webViewSrc") {
+ item.attributes?.push({
+ type: "label",
+ name: attribute.name,
+ value: attribute.value
+ });
}
}
@@ -64,6 +73,11 @@ function parseNoteMeta(noteMeta: NoteMeta, docNameRoot: string): HiddenSubtreeIt
});
}
+ // Handle web views
+ if (noteMeta.type === "webView") {
+ item.type = "webView";
+ }
+
// Handle children
if (noteMeta.children) {
const children: HiddenSubtreeItem[] = [];
diff --git a/src/services/meta/note_meta.ts b/src/services/meta/note_meta.ts
index 0aaafb6b59..681ca4f8c5 100644
--- a/src/services/meta/note_meta.ts
+++ b/src/services/meta/note_meta.ts
@@ -1,3 +1,4 @@
+import type { NoteType } from "../../becca/entities/rows.js";
import type AttachmentMeta from "./attachment_meta.js";
import type AttributeMeta from "./attribute_meta.js";
@@ -15,7 +16,7 @@ export default interface NoteMeta {
notePosition?: number;
prefix?: string | null;
isExpanded?: boolean;
- type?: string;
+ type?: NoteType;
mime?: string;
/** 'html' or 'markdown', applicable to text notes only */
format?: "html" | "markdown";