Closed aidenlx closed 2 years ago
icon shortcode v0.9.0 support callout icon, closing this now.
And I was just working on this last night! 😁
btw, if you are implementing a interface to manage custom callout icon, you can check out getIconFromUser method which can open a modal to prompt user for icon selection (available since v0.6.1)
I just inject a detached stylesheet with the custom admonitions defined as callouts, with icons defined using an SVG tag.
I've done it in post processor, adding a mutation observer for icon injection and insert custom icon when no icon is rendered by default renderer. https://github.com/aidenlx/obsidian-icon-shortcodes/blob/master/src/post-ps/callout-icon.ts
I'm the dev of Icon shortcodes plugin, a plugin that includes an icon manager to manage user-imported custom icons, and icon packs such as Font Awesome, Remixicon, RPG Awesome, etc.
In the upcoming v0.7.0+, it will no longer bundle any svg icons and use lucide icons available in obsidian v0.13.27+, and provide a icon pack browser to easily download icon packs. Imported icons are stored as files in
.obsidian/icons
, so including more icons won't cause memory problem caused by loading icons in json file or increase bundle sizeYou can check here for details about its api: https://github.com/aidenlx/obsidian-icon-shortcodes#for-developer. link favicon already support icon shortcodes so it might be a good place to reference code. In v0.7.0+, the api doesn't contain any breaking changes, so it's safe to develop against published version of obsidian-icon-shortcodes.
feel free to ask if you have any question :)