From 84dd1282dc139e9c6dca93e463aca98fb5c35ad9 Mon Sep 17 00:00:00 2001 From: Antonio Laguna Date: Wed, 19 Apr 2017 17:37:03 +0200 Subject: [PATCH] Created Plugin development (markdown) --- Plugin-development.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Plugin-development.md diff --git a/Plugin-development.md b/Plugin-development.md new file mode 100644 index 0000000..29e52db --- /dev/null +++ b/Plugin-development.md @@ -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. \ No newline at end of file