-
Notifications
You must be signed in to change notification settings - Fork 22
A lot of small fixes #78
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
Changes from all commits
c91af45
252e7d2
822a2e7
ba2348b
cfcaa22
47d9c82
7b77390
afe4815
7b5b5a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
## Welcome | ||
|
||
Here you will find documentation on usage tips, design information, plugin development and more. | ||
Here you will find documentation on usage tips, design information, plugin development, and more. | ||
|
||
If you have just started using Flow, please head over to the [Usage Tips](/usage-tips.md) section to find out how you can get the most out of Flow. Otherwise if you are completely new to Flow and want to find out its features and give it a spin, please visit [here](https://github.com/Flow-Launcher/Flow.Launcher/#-features). | ||
If you have just started using Flow, please head over to the [Usage Tips](/usage-tips.md) section to find out how you can get the most out of Flow. Otherwise, if you are completely new to Flow and want to find out its features and give it a spin, please visit [here](https://github.com/Flow-Launcher/Flow.Launcher/#-features). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
<p align="center"> | ||
<a href="https://flow-launcher.github.io"> | ||
<img width="250px" src="https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher/5ba4514f31e624c679628d4dfe89036c0e24006c/Doc/Logo/resources/flow-header-square-transparent.png"> | ||
</a> | ||
</p> | ||
<a href="https://www.flowlauncher.com/"> | ||
<img | ||
width="250" | ||
src="https://cdn.jsdelivr.net/gh/Flow-Launcher/Flow.Launcher@5ba4514f31e624c679628d4dfe89036c0e24006c/Doc/Logo/resources/flow-header-square-transparent.png" | ||
alt="Flow Launcher logo" | ||
> | ||
</a> | ||
Comment on lines
+1
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for |
||
|
||
# Flow Launcher | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
Flow is written in C#, so plugins written in .Net platform can directly communicate with Flow without extra protocols. | ||
Flow is written in C#, so plugins written in .NET platform can directly communicate with Flow without extra protocols. | ||
|
||
## Initialization | ||
|
||
For C# Plugins, We recommend you use the [dotnet template](https://github.com/Flow-Launcher/dotnet-template) to generate a plugin template. | ||
|
||
In order to be recognized as a Flow DotNet plugin, the directory needs to have at least two files | ||
1. [`plugin.json`](plugin.json.md) | ||
2. A Dotnet Assembly that implements **[IPlugin](API-Reference/Flow.Launcher.Plugin/iplugin.md)** or **[IAsyncPlugin](API-Reference/Flow.Launcher.Plugin/iasyncplugin.md)** (remember to reference [Flow.Launcher.Plugin](https://www.nuget.org/packages/Flow.Launcher.Plugin/) by Nuget). The plugin template will add the reference and create a `Main.cs` that implements `IPlugin`. | ||
To be recognized as a Flow DotNet plugin, the directory needs to have at least two files | ||
1. [`plugin.json`](/plugin.json.md) | ||
2. A Dotnet Assembly that implements **[IPlugin](/API-Reference/Flow.Launcher.Plugin/IPlugin.md)** or **[IAsyncPlugin](/API-Reference/Flow.Launcher.Plugin/IAsyncPlugin.md)** (remember to reference [Flow.Launcher.Plugin](https://www.nuget.org/packages/Flow.Launcher.Plugin/) by Nuget). The plugin template will add the reference and create a `Main.cs` that implements `IPlugin`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to case-sensitivity, the links to the auto-generated docs were leading to 404. |
||
|
||
Find our API Reference [here](API-Reference/) | ||
Find our API Reference [here](/API-Reference/Flow.Launcher.Plugin.md) | ||
|
||
|
||
A sample CSharp Plugin [here](https://github.com/Flow-Launcher/plugin-samples) | ||
|
||
## IPlugin/IAsyncPlugin | ||
|
||
The `Main`class that implements **[IPlugin](API-Reference/Flow.Launcher.Plugin/iplugin.md)** or **[IAsyncPlugin](API-Reference/Flow.Launcher.Plugin/iasyncplugin.md)** will handle the query search with Flow. | ||
The `Main`class that implements **[IPlugin](/API-Reference/Flow.Launcher.Plugin/IPlugin.md)** or **[IAsyncPlugin](/API-Reference/Flow.Launcher.Plugin/IAsyncPlugin.md)** will handle the query search with Flow. | ||
|
||
**[IPlugin](API-Reference/Flow.Launcher.Plugin/iplugin.md)** interface contains two required methods: | ||
**[IPlugin](/API-Reference/Flow.Launcher.Plugin/IPlugin.md)** interface contains two required methods: | ||
1. `void Init(PluginInitContext context)` | ||
- [PluginInitContext](https://github.com/Flow-Launcher/Flow.Launcher/blob/master/API-Reference/Flow.Launcher.Plugin/PluginInitContext.cs) exposes some API from Flow and an metadata object for your plugin. | ||
- [PluginInitContext](/API-Reference/Flow.Launcher.Plugin/PluginInitContext.md) exposes some API from Flow and a metadata object for your plugin. | ||
- It will be invoked before the invocation of `Query`, so you can do some preparation here. | ||
- We recommend you do expensive operations in this method instead of Object Constructor because this method will be executed in parallel with other plugins. | ||
2. `List<Result> Query(Query query)` | ||
- `Query` will be invoked when user activate this plugin with specific ActionKeyword. | ||
- A `List` of [Result](/API-Reference/Flow.Launcher.Plugin/result.md) object should be returned. | ||
- `Query` will be invoked when user activates this plugin with specific ActionKeyword. | ||
- A `List` of [Result](/API-Reference/Flow.Launcher.Plugin/Result.md) object should be returned. | ||
|
||
**[IAsyncPlugin](API-Reference/Flow.Launcher.Plugin/iasyncplugin.md)** is the async version of **[IPlugin](API-Reference/Flow.Launcher.Plugin/iplugin.md)** | ||
**[IAsyncPlugin](/API-Reference/Flow.Launcher.Plugin/IAsyncPlugin.md)** is the async version of **[IPlugin](/API-Reference/Flow.Launcher.Plugin/IPlugin.md)** | ||
- Instead of implementing `Init` and `Query`, you will need to implement `InitAsync`and `QueryAsync`, which use `Task`,`Task<List<Result>` as return value to allow using `async/await` strategy | ||
- `QueryAsync` provides a `CancellationToken token` to allow you to check whether user has typed a new query. | ||
|
||
|
||
## Additional interfaces | ||
|
||
Besides the basic implementation of **IPlugin/IAsyncPlugin**, plugins can also implement a series of interfaces that belongs to **IFeatures** to control more communication with Flow. | ||
Besides the basic implementation of **IPlugin/IAsyncPlugin**, plugins can also implement a series of interfaces that belong to **IFeatures** to control more communication with Flow. | ||
|
||
**Remarks**: You should implement these interfaces in the same class that implements **IPlugin/IAsyncPlugin**. | ||
|
||
### [IContextMenu](API-Reference/Flow.Launcher.Plugin/icontextmenu.md) | ||
### [IContextMenu](/API-Reference/Flow.Launcher.Plugin/IContextMenu.md) | ||
|
||
`LoadContextMenus` will be invoked when users expand the context menu of a specific Result. | ||
The return value of `LoadContextMenus` is similar to Results from `Query/QueryAsync`. | ||
|
||
### [IReloadable](API-Reference/Flow.Launcher.Plugin/ireloadable.md)/[IAsyncReloadable](API-Reference/Flow.Launcher.Plugin/iasyncreloadable.md) | ||
### [IReloadable](/API-Reference/Flow.Launcher.Plugin/IReloadable.md)/[IAsyncReloadable](API-Reference/Flow.Launcher.Plugin/IAsyncReloadable.md) | ||
|
||
`ReloadData/ReloadDataAsync` will be invoked when users click the `Reload Plugin Data` command from _sys_ plugin. Generally, it is used to reload some cache (such as the programs information cached in _Program_ plugin). | ||
|
||
### [IPluginI18n](/API-Reference/Flow.Launcher.Plugin/iplugini18n.md) | ||
### [IPluginI18n](/API-Reference/Flow.Launcher.Plugin/IPluginI18n.md) | ||
|
||
**IPluginI18n** means the plugin has been internationalized. Therefore, Flow will load the additional language resources from `/Languages` when loading the plugin. | ||
By implementing this interface with additional language files, Flow will be able to load plugin-specific localized language resources. You will be able to get the translated text with `IPublicAPI.GetTranslation(string key)`. | ||
|
@@ -60,13 +60,13 @@ The Language Resource file will need to be a list of **key/value** pair. Follow | |
|
||
Plugins are required to implement **IPublicI18n** to let Flow load Language resources. | ||
|
||
### [IResultUpdated](API-Reference/Flow.Launcher.Plugin/iresultupdated.md) | ||
### [IResultUpdated](/API-Reference/Flow.Launcher.Plugin/IResultUpdated.md) | ||
|
||
|
||
Implementing **IResultUpdated** provides a way to return part of the query results early. This is generally useful for plugins with long running queries. | ||
Implementing **IResultUpdated** provides a way to return part of the query results early. This is generally useful for plugins with long-running queries. | ||
|
||
To early return a result to Flow, you will need to invoke `ResultUpdated` event with an `ResultUpdatedEventArgs`, which includes the current `Query` object and the List of `Result` objects similar to the return value in `Query(Async)`. | ||
|
||
### [IDisposable](https://docs.microsoft.com/en-us/dotnet/api/system.idisposable) *Flow 1.8.0 or higher* | ||
|
||
Implementing **IDisposable** to dispose unmanaged resource in the plugin. `Dispose()` will be called when Flow exit. | ||
Implementing **IDisposable** to dispose unmanaged resource in the plugin. `Dispose()` will be called when Flow exit. |
Uh oh!
There was an error while loading. Please reload this page.