Skip to content

Commit 726bbc6

Browse files
updates
1 parent 9b18596 commit 726bbc6

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

src/gettingstarted/extension/cplusplus.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ A native plugin is a [Qt Plugin](https://doc.qt.io/qt-6/plugins-howto.html#the-l
1717
## CMake
1818

1919
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.
2321
This is the standard plugin directory structure of a plugin:
2422

2523
```
@@ -32,7 +30,7 @@ This is the standard plugin directory structure of a plugin:
3230
└── …
3331
```
3432

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)):
3634

3735
```json
3836
{
@@ -44,7 +42,7 @@ A basic metadata file looks like this (See also the [metadata.json files](https:
4442
}
4543
```
4644

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)):
4846

4947
```cmake
5048
cmake_minimum_required(VERSION 3.16)
@@ -61,8 +59,7 @@ The relevant base classes and the `ALBERT_PLUGIN` macro takes care of this.
6159
Albert plugins have to inherit the [`PluginInstance`](https://albertlauncher.github.io/reference/classalbert_1_1PluginInstance.html) class.
6260
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.
6361

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)):
6663

6764
```cpp
6865
#pragma once

src/gettingstarted/extension/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,18 @@ A quick comparison:
2121
- Easy to distribute/share.
2222
- Only a subset of the internal API.
2323

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.
38+

src/gettingstarted/faq.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ albert toggle
4646
- [KDE documentation](https://docs.kde.org/stable5/en/khelpcenter/fundamentals/shortcuts.html)
4747
- You are welcome to improve this list.
4848

49-
50-
## How to make hotkeys have less latency?
51-
52-
Note that the above runs a new app instance, which is relatively heavy.
49+
The above runs a new app instance, which is relatively heavy.
5350
Another approach is to pipe the command you want to send directly into the albert IPC socket.
5451

5552
```bash
@@ -113,11 +110,3 @@ QT_LOGGING_RULES='*=true' QT_DEBUG_PLUGINS=1 albert
113110
# Debug DBus
114111
QT_LOGGING_RULES='default*=true' QDBUS_DEBUG=1
115112
```
116-
117-
118-
## How to version plugins?
119-
120-
If it has a public API `major.minor.patch` else `minor.patch`.
121-
Increase major if the API breaks.
122-
Increase minor if the API got some backward compatible additions or the user experiences noticable changes.
123-
In all other cases increase patch.

0 commit comments

Comments
 (0)