You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have configured some custom themes using bat that I wanted to use with this plugin, but I couldn't load them through the provided configurations.
What I ended up doing was patching the lib.rssave_image() method with this snippet:
ifletSome(path) = &opts.themes_path{
ha.add_from_folder(path).expect("Failed to load themes on path");}
And I am adding the themes_path as part of the Opts struct.
This works since I can now load my custom bat themes using the theme configuration option, but it feels sub-optimal because it gets run every time a new image is created. Since the process itself is very fast, I don't mind, but I was wondering if:
Is there a better place to include loading these themes? Maybe creating a SiliconCache or SiliconCacheBuild function loads them once and makes them available to the user. Similar to what you would do with bat cache --build.
Is there an easier way to accomplish this that I might miss?
Adding an image of the code, I'm referring to it because I love the images created by silicon and this plugin:
The text was updated successfully, but these errors were encountered:
- Added `list_themes()` function to retrieve available themes.
- Added `config_path()` function to retrieve the project's config path.
- Added `rebuild_themes()` function to rebuild themes with an optional path parameter.
Fixes: #47
Related: #36#41
I have configured some custom
themes
usingbat
that I wanted to use with this plugin, but I couldn't load them through the provided configurations.What I ended up doing was patching the
lib.rs
save_image()
method with this snippet:And I am adding the
themes_path
as part of theOpts
struct.This works since I can now load my custom
bat
themes using thetheme
configuration option, but it feels sub-optimal because it gets run every time a new image is created. Since the process itself is very fast, I don't mind, but I was wondering if:SiliconCache
orSiliconCacheBuild
function loads them once and makes them available to the user. Similar to what you would do withbat cache --build
.Adding an image of the code, I'm referring to it because I love the images created by
silicon
and this plugin:The text was updated successfully, but these errors were encountered: