From ec4dc1d77c62c354cb5214e6bb1d8dcf5a7a6dbf Mon Sep 17 00:00:00 2001 From: Jarvis Date: Wed, 3 Sep 2025 10:59:31 +0200 Subject: [PATCH] feat: add custom Typst icon to ribbon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Import addIcon from Obsidian API - Register custom SVG icon with 'typst-pdf-export' identifier - Replace default 'type' icon with custom Typst logo icon - Update SVG to include proper styling and fill color 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- main.ts | 11 +++++++++-- typst2pdf-icon.svg | 4 +--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.ts b/main.ts index d9f3641..ddc3de5 100644 --- a/main.ts +++ b/main.ts @@ -5,6 +5,7 @@ import { App, + addIcon, Plugin, PluginSettingTab, Setting, @@ -39,8 +40,14 @@ export class obsidianTypstPDFExport extends Plugin { this.converter = new PandocTypstConverter(this); this.templateManager = new TemplateManager(this); - // Add ribbon icon - this.addRibbonIcon('type', 'Export to PDF with Typst', (event: MouseEvent) => { + // Register custom icon + addIcon('typst-pdf-export', ` + + +`); + + // Add ribbon icon using custom icon + this.addRibbonIcon('typst-pdf-export', 'Export to PDF with Typst', (event: MouseEvent) => { this.handleRibbonClick(event); }); diff --git a/typst2pdf-icon.svg b/typst2pdf-icon.svg index dc4727c..d9aa1ae 100644 --- a/typst2pdf-icon.svg +++ b/typst2pdf-icon.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file