Plugins
SliDesk has a plugin system, so that a minimum number of functions can be included in the kernel to cover the majority of needs, with the possibility of extending it with new functions specific to a presentation.
To achieve this, an architecture must be defined, something simple that a novice or experienced developer can quickly understand.
For a plugin to be taken into account by SliDesk, a "plugins" directory must be created at the root of the presentation. In this folder, create a directory for the plugin, and add a "plugin.json" file.
This JSON file defines the anchor points to which the plugin is attached.
These points are separated into two parts: files to be loaded (in the form of arrays) and code to be inserted (in the form of character strings).
Plugins can be front or back plugins
This json
file describes the comportement of the plugin. Each keys of the json correspond to a "hook":
addHTML
: add some html at the end of the presentationaddHTMLFromFiles
: an array of html files to append in thebody
addScripts
: an array of ressources to load (will be convert toscript
tag withsrc
value as each entry)addSpeakerScripts
: an array of ressources to load (will be convert toscript
tag withsrc
value as each entry) but on speaker viewaddStyles
: an array of ressources to load (will be convert tolink
tag withhref
value as each entry)addSpeakerStyles
: an array of ressources to load (will be convert tolink
tag withhref
value as each entry) but on speaker viewonSlideChange
: javascript code which will be executed after a slide is changedonSpeakerViewSlideChange
: javascript code which will be executed after a slide is changedaddWS
: a.mjs
file will be imported on Server launchaddRoutes
: a.mjs
file will be imported on Server launch
If you want to use one of the "core" plugins, available in this repository, you don't need to copy them. You have just to create a .env
file in your root directory of the talk, and precise the plugins you need:
PLUGINS="source, qrcode"
For external plugins, you have to copy each directories of plugins you want to use in your plugins
.