Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add integrations using config file #218

Open
dafta opened this issue Sep 23, 2024 · 1 comment
Open

[Feature] Add integrations using config file #218

dafta opened this issue Sep 23, 2024 · 1 comment

Comments

@dafta
Copy link

dafta commented Sep 23, 2024

It would be great if there was an option to add integrations using your own config, for instance by adding an option to integration options called query_buffer_images, the same way a user can currently override the resolve_image_path function.

The way it would work is, the plugin would check if an integration is enabled, and if an override for the query_buffer_images function exists in the config, it would use that instead of the integration definition in lua/image/integrations. This way, it would be easier to replace the query images function for existing integrations, but more importantly, it would be easier to add custom integrations.

The reason this would be a great addition is for file formats that are rare, or perhaps unique in an environment, and it wouldn't make sense to add a whole new integration and merge it into the plugin when maybe 10 people use it or even know of the format. For instance, we use a custom file format at work that can embed images, and adding support for it using config options is a lot easier than adding a new integration, and then having to update the files that have been changed for it to work every plugin update.

The name of the integration can be inferred from the key used in the integrations dictionary in the options, and the debug variable can be added to the config as well. As for default options, there could be a key for that, but since it's already being defined in the configuration, it might just be easier to define the options using the already existing option keys.

@3rd
Copy link
Owner

3rd commented Sep 24, 2024

Hey, yep definitely, everything should be plug and play in the end - integrations, image processors and backends.
I've been slowly working towards that but didn't have enough time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants