Meows.Plugins.Template
1.8.0
dotnet new install Meows.Plugins.Template@1.8.0
Meows plugin template
A dotnet new template for a Meows plugin. It writes the
project, the plugin class, a view and a view model, ready to build and drop into a plugins folder.
dotnet new install Meows.Plugins.Template
dotnet new meows-plugin -n WeatherWatch
That gives you:
WeatherWatch/
.github/workflows/release.yml a tag becomes a release with the zip attached
WeatherWatch.csproj net10.0, Avalonia and the contract, both runtime excluded
WeatherWatch.cs the IMeowsPlugin implementation
WeatherWatchView.axaml the tab, using theme colours and translated strings
WeatherWatchView.axaml.cs
WeatherWatchViewModel.cs with the host wired in
Strings/Strings.en.json what the tab says
Strings/Strings.de.json the same in German
The view asks the shell for its colours with {DynamicResource Meows...} and its words with
{m:Tr weatherwatch.title}, so a generated plugin follows the theme and the language from the
first build. Delete either if you would rather not.
The plugin id is taken from the name in lower case. Change it before anyone installs the plugin: it is the settings key, so moving it later orphans whatever was stored.
--Category "group.everyday" sets the heading it appears under on the Plugins tab. The built-in
headings are keys (group.everyday, group.disk, group.bot) and are translated; anything else
makes a group of its own and is shown exactly as written. The shell keeps no list of valid ones.
--Repository https://github.com/you/WeatherWatch names the repository it lives in. Meows shows
it on the plugin's card as a link, and once the plugin was installed from a zip, asks that
repository once a day whether a newer release is out and offers it on the card. Leave it off and
the card just has no link. Authors in the csproj is your name; left as the project name, no
author is shown.
The project comes with .github/workflows/release.yml: push a tag like v1.0.0 and GitHub
builds the plugin at that version, zips the build folder and attaches it to a release. That zip
is what Install plugin… takes.
Building and installing it
dotnet build -c Release -o WeatherWatch
The output folder must be named after the dll. Put it under the plugins directory beside
Meows.exe, or point MEOWS_PLUGINS_DIR at a folder of your own, which adds to the search rather
than replacing it. To hand it to someone, zip the whole folder: Install plugin… on their
Plugins tab takes the zip from there.
Meows.exe --list-plugins
says what was found and why anything was refused.
Why both references exclude the runtime
The shell supplies Avalonia and the contract at run time, and there has to be exactly one copy of
each. A plugin carrying its own Avalonia hands back a Control of a type the shell cannot host.
Meows checks the version of both when it loads a plugin and refuses anything it cannot honour, with
the reason on the plugin's card rather than a crash later.
Full documentation: PLUGIN-GUIDE.md. For one part of the contract at a time, the examples: five small plugins, a schedule and a condition, handoffs, the store and Ctrl+K, background work and dialogs, and the least a plugin can be.
MIT licensed.
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.