Open KhangHLe opened 2 months ago
At the moment, you can just call app.plugins.getPlugin('iconic').saveFileIcon(object, icon, color)
.
The method expects these parameters:
object
just needs to be { id: 'Relative/Path/To/Your/File.md' }
.icon
should be a string (an icon ID / an emoji) or just null
.color
should be a string (red
orange
yellow
green
cyan
blue
purple
pink
gray
/ #hexcode
) or just null
.After that, call getPlugin('iconic').refreshIconManagers()
to update the UI. It's not a public API so you shouldn't rely on this code forever, but it works pretty well right now.
I'll think about making this easier to use in the future 💜
Thank you! A simpler suggestion would be to have a setting to apply the current icon on the template file to the note
Allow us to set icons through the plugin API, my use case would be to have Templater automatically set icons for specific templates. Unless it is already possible, I'd like to know how 😬