From f1e9eebd3968d0a56a8109ac8d71751c0c96a323 Mon Sep 17 00:00:00 2001 From: Hongbo Wu Date: Tue, 31 Jan 2023 12:14:23 +0800 Subject: [PATCH] fix: add back the ribbon icon for the ease of usage --- src/main.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/main.ts b/src/main.ts index e197431..94565c5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,7 @@ import { DateTime } from "luxon"; import Mustache from "mustache"; import { + addIcon, App, normalizePath, Notice, @@ -119,6 +120,23 @@ export default class OmnivorePlugin extends Plugin { }, }); + const iconId = "Omnivore"; + // add icon + addIcon( + iconId, + ` + + + + ` + ); + + // This creates an icon in the left ribbon. + this.addRibbonIcon(iconId, iconId, async (evt: MouseEvent) => { + // Called when the user clicks the icon. + await this.fetchOmnivore(); + }); + // This adds a settings tab so the user can configure various aspects of the plugin this.addSettingTab(new OmnivoreSettingTab(this.app, this)); }