mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-31 00:39:48 +02:00
Created Plugin development (markdown)
13
Plugin-development.md
Normal file
13
Plugin-development.md
Normal file
@@ -0,0 +1,13 @@
|
||||
Almost every single feature of WebSlides is a plugin that can be overwritten and you are able to create your custom plugins. Just call `registerPlugin` (as seen on [Arbitrary Link Text](Core API)) **before creating** the instance:
|
||||
|
||||
```javascript
|
||||
// Adding the constructor to WebSlides
|
||||
WebSlides.registerPlugin('myPlugin', MyPlugin);
|
||||
|
||||
// Starting WebSlides
|
||||
// Your plugin will be constructed at this time and it will receive the webslides instance as the only parameter.
|
||||
const ws = new WebSlides();
|
||||
// You can also access ws.plugins.myPlugin now
|
||||
```
|
||||
|
||||
This allows you to rewrite the navigation to use a menu (for example) or add that missing piece of functionality you'd like to see. See [this part of the code](../src/js/modules/webslides.js#L11) to see all the plugins we're using and the name they're using.
|
Reference in New Issue
Block a user