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
Copy file name to clipboardExpand all lines: src/gettingstarted/extension/cplusplus.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,7 @@ A native plugin is a [Qt Plugin](https://doc.qt.io/qt-6/plugins-howto.html#the-l
17
17
## CMake
18
18
19
19
Having a standardized plugin project structure the `albert_plugin` macro takes care of most of the CMake boilerplate code.
20
-
Read the documentation header of the [CMake module](https://raw.githubusercontent.com/albertlauncher/albert/main/cmake/albert-macros.cmake) before you proceed.
21
-
Its just a few lines.
22
-
Do not skip this!
20
+
Read its documentation in the header of the [CMake module](https://raw.githubusercontent.com/albertlauncher/albert/main/cmake/albert-macros.cmake) before you proceed.
23
21
This is the standard plugin directory structure of a plugin:
24
22
25
23
```
@@ -32,7 +30,7 @@ This is the standard plugin directory structure of a plugin:
32
30
└── …
33
31
```
34
32
35
-
A basic metadata file looks like this (See also the [metadata.json files](https://github.com/search?q=repo%3Aalbertlauncher%2Fplugins+path%3A**%2Fmetadata.json&type=code) of the official plugins):
33
+
A basic metadata file looks like this (See also the [metadata.json files of the official plugins](https://github.com/search?q=repo%3Aalbertlauncher%2Fplugins+path%3A**%2Fmetadata.json&type=code)):
36
34
37
35
```json
38
36
{
@@ -44,7 +42,7 @@ A basic metadata file looks like this (See also the [metadata.json files](https:
44
42
}
45
43
```
46
44
47
-
A minimal working CMakeLists.txt (See also the [CMakeLists.txt files](https://github.com/search?q=repo%3Aalbertlauncher%2Fplugins+path%3A**%2FCMakeLists.txt&type=code) of the official plugins):
45
+
A minimal working CMakeLists.txt (See also the [CMakeLists.txt files of the official plugins](https://github.com/search?q=repo%3Aalbertlauncher%2Fplugins+path%3A**%2FCMakeLists.txt&type=code)):
48
46
49
47
```cmake
50
48
cmake_minimum_required(VERSION 3.16)
@@ -61,8 +59,7 @@ The relevant base classes and the `ALBERT_PLUGIN` macro takes care of this.
61
59
Albert plugins have to inherit the [`PluginInstance`](https://albertlauncher.github.io/reference/classalbert_1_1PluginInstance.html) class.
62
60
Usually you dont want to subclass `PluginInstance` directly but rather [`ExtensionPlugin`](https://albertlauncher.github.io/reference/classalbert_1_1ExtensionPlugin.html) which implements the [`Extension`](https://albertlauncher.github.io/reference/classalbert_1_1Extension.html) interface using the metadata of the plugin instance.
63
61
64
-
65
-
A basic plugin looks like this (Check the [plugin header files](https://github.com/search?q=repo%3Aalbertlauncher%2Fplugins+path%3A**%2FPlugin.h&type=code) of the official plugins for reference):
62
+
A basic plugin looks like this (See also the [plugin header files of the official plugins](https://github.com/search?q=repo%3Aalbertlauncher%2Fplugins+path%3A**%2FPlugin.h&type=code)):
Copy file name to clipboardExpand all lines: src/gettingstarted/extension/index.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,3 +21,18 @@ A quick comparison:
21
21
- Easy to distribute/share.
22
22
- Only a subset of the internal API.
23
23
24
+
25
+
## General considerations and best practices
26
+
27
+
### How to version plugins
28
+
29
+
If it has a public API `major.minor.patch` else `minor.patch`.
30
+
Increase major if the API breaks.
31
+
Increase minor if the API got some backward compatible additions or the user experiences noticable changes.
32
+
In all other cases increase patch.
33
+
34
+
### Avoiding name conflicts of extension identifiers
35
+
36
+
If your plugin provides multiple extensions it's a good idea to prepend the plugin id to the extension id to avoid name conflicts of extensions, e.g. `files.root_browser`.
37
+
The root extension is fine to match the plugin id.
0 commit comments