Here are some fundamental concepts for building plugins step by step:
Fork the plugin marketplace repository: https://github.com/ONLYOFFICE/onlyoffice.github.io.
You get a repository with the following address - https://github.com/YOUR-USERNAME/ONLYOFFICE/onlyoffice.github.io.
Add a folder for your plugin to onlyoffice.github.io/sdkjs-plugins/content/.
Add the ONLYOFFICE style sheet to the index.html file to adjust your plugin to the ONLYOFFICE editor style:
<link rel="stylesheet" href="https://onlyoffice.github.io/sdkjs-plugins/v1/plugins.css">
Create the translations folder in the plugin directory with .json files for each language you want to add the translation for. Follow the instructions here to localize and apply the translations.
Prepare icons for the plugin and put them into the resources folder. Follow the instructions here to specify icon parameters in the config.json file.
Put all the prepared files to the plugin folder and push it to the remote repository. That’s it! Now you can connect it to the desktop or web versions of ONLYOFFICE editors and test.
Test the plugin in the ONLYOFFICE Desktop Editors.
You can run this app in the debug mode with the --ascdesktop-support-debug-info flag. To do this, follow the instructions here depending on the operating system you use.
Test the plugin in the web version.
To create an extension, open the onlyoffice.github.io/store/plugin-dev/extension/inject.js file and assign the path to your plugin on GitHub Pages site to the URL_TO_PLUGIN variable:
var URL_TO_PLUGIN = "https://YOUR-USERNAME.github.io/onlyoffice.github.io/sdkjs-plugins/content/helloworld/"
To debug ONLYOFFICE plugins in the web editors, follow the instructions here.
If you want your plugin to be available to other users in the ONLYOFFICE Plugin Marketplace, suggest it for publishing by creating a pull request from your fork to https://github.com/ONLYOFFICE/onlyoffice.github.io. If your plugin works properly, your pull request will be approved and the plugin will appear in the marketplace.
You can discuss plugin development, request a feature, or report a bug by posting an issue in the marketplace repository.