1
0
mirror of https://github.com/webslides/WebSlides.git synced 2025-08-30 16:30:04 +02:00

Updated Plugin development (markdown)

Antonio Laguna
2017-04-19 17:43:39 +02:00
parent 8b8474240a
commit e6f6a9067a

@@ -1,4 +1,4 @@
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 [the API](Core-API)) **before creating** the instance:
Almost every single feature of WebSlides is a plugin. The core only consists of methods that allows you to navigate through the slides while the plugins do the rest. They can be overwritten and you are able to create your custom plugins. Just call `registerPlugin` (as seen on [the API](Core-API)) **before creating** the instance:
```javascript
// Adding the constructor to WebSlides
@@ -10,4 +10,17 @@ 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.
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.
Here's the list with links to any plugins that have any relevant information:
- `autoslide` - Autosliding plugin that will autoadvance the slides over the time.
- `clickNav` - Allows to click on the page to get to the next slide.
- `grid` - Shows a grid over the page for easy prototyping by pressing `ENTER`.
- `hash` - In charge of updating the hash and reacting to any changes to it.
- `keyboard` - Handles keyboard shortcuts.
- `nav` - Shows the navigation on the bottom with the arrows and numbers. And keeps it updated!
- `scroll` - Allows to navigate with scroll.
- `touch` - Allows to navigate with touch gestures.
- `video` - Allows to pause video and autoplay them upon entering the slide.
- `youtube` - Allows to control YouTube videos.