If you are interested in developing a plugin for Saber, please take the time to read and understand all of the documentation on this page.
- To begin, you should start by cloning or downloading a git repository for one of Saber's Plugins. For example, you could clone the Page List plugin. All plugins built for Saber uses the Saber.Vendor NuGet package to communicate with Saber and includes a set of files used for publishing your plugin using Gulp.
- Run the command npm install from within the newly cloned folder.
- You can delete all .csfiles along with any .html, .css, .less, and .js files (except gulpfile.js) within your newly cloned folder to start from scratch.
- Delete the existing .sln (solution) file and rename your .csproj (project) file to the desired name for your plugin (e.g. Saber.Vendors.My-Plugin.csproj), then open your project file in a text editor to make any string replacements for the name of your plugin as well.
- Open package.json in a text editor to make any string replacements for the name of your plugin.
- Open the .csproj file in Visual Studio to start developing your plugin for Saber!
- Right-click your project in Visual Studio and go to Properties
- Make sure the Assembly Name and Default Namespace fields use Saber.Vendors.MyPlugin where MyPlugin is the name of your plugin.
- Save your project solution in Visual Studio and start developing!
You should research and fully understand the tools you have access to when developing a plugin for Saber.
- Saber.Core has many application-wide features that you can utilize when using the Saber.Vendor NuGet package.
- Query is an MSSQL/Dapper library that allows you to access stored procedures within Saber's database and is part of the Saber.Vendor NuGet package.
- Saber uses Tapestry as a CSS grid & UI framework for Saber's Editor. You will need to learn how to use Tapestry if you wish to create plugins that modify or enhance Saber's Editor.
- Saber uses the Datasilk Core MVC NuGet package to render web pages instead of using Microsoft's MVC framework, and is included in the Saber.Vendor NuGet package.
Publish a Release of your Plugin
To publish your plugin, run the command ./publish.bat. When the command completes, you can find your release .7z zip file under /bin/Publish/. This is the file that you should share with the public for download. It will contain two folders, win-x64 and linux-x64, for Windows operating systems and supported Linux distributions. For more information about which Linux distributions are supported, visit Microsoft's RID catalog.
Also, before publishing, you should consider the following steps:
- Right-click your project in Visual Studio and go to Properties, then navigate to the Package tab
- Make sure the Package id and Product fields use Saber.Vendor.MyPlugin where MyPlugin is the name of your plugin.
- Open your gulpfile.js file
- Replace the value for the app variable var app = '' with your plugin name (with no spaces or special characters).
Find the comment //include custom resources inside the function
publishToPlatform(platform) to optionally include any files or folders that you wish to publish
along with your plugin's release files. Please refer to gulp.src()
documentation to learn how to use regular expressions to include or exclude files & folders from the list.
NOTE: There may already be custom resources included based on the GitHub repository that you cloned as a starting point for your own plugin. You should delete any of these custom resources that are unneccessary from your hard drive & from the gulpfile.
- Update the README.md file with a description about your plugin, installion instructions, and a guide on how to use your plugin within Saber's Editor UI.