code icon indicating copy to clipboard operation
code copied to clipboard

Add wiki page to create a plugin

Open ghost opened this issue 2 years ago • 1 comments

Problem

I am working on #78, however I can't find any info on how to create a plugin.

Proposal

Add docs for creating plugins, using the API...

Prior Art (Optional)

No response

ghost avatar May 03 '23 11:05 ghost

To create a PR for a new core plugin the simplest way is to inspect the code of the existing ones and also of PluginManager.vala. In activate() function of the .vala file, you need to connect to the relevant hooks (signals) from the plugin manager and write the necessary handlers. Otherwise the code is just boilerplate. The editorconfig plugin is one of the simplest. You will also need .plugin and meson.build files but these are pretty self explanatory. You also need to add your plugin to plugins/meson.buid for it to compile.

While a lot of Git stuff is in the main code, I guess a Github plugin is a valid use since in principle there might be e.g. a Gitlab plugin as an alternative.

jeremypw avatar Dec 15 '23 18:12 jeremypw