From c7c09644f0238bb0b27e2af4f974e9df7d7f1ab2 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sun, 26 Apr 2020 08:34:02 +0200 Subject: [PATCH] esm readme tweak --- README.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6ac29e6f..1a940801 100644 --- a/README.md +++ b/README.md @@ -189,10 +189,9 @@ Here's how to import and initialize the ES module version of reveal.js, includin ```html ``` @@ -625,6 +624,8 @@ loaded when they become visible. ### Plugins +**Outdated, this will be rewritten to match the 4.0 plugin API** + Plugins should register themselves with reveal.js by calling `Reveal.registerPlugin( MyPlugin )`. Registered plugins _must_ expose a unique `id` property and can optionally expose an `init` function that reveal.js will call to initialize them. When reveal.js is booted up via `initialize()`, it will go through all registered plugins and invoke their `init` methods. If the `init` method returns a Promise, reveal.js will wait for that promise to be fulfilled before finishing the startup sequence and firing the [ready](#ready-event) event. Here’s an example of a plugin that does some asynchronous work before reveal.js can proceed: @@ -643,11 +644,15 @@ Reveal.initialize({ } ); ``` -Note that reveal.js will *not* wait for init Promise fulfillment if the plugin is loaded as an [async dependency](#dependencies). If the plugin’s init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. +If the plugin’s init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. + +### Manually Registering Plugins + +TBD. Describe how plugins can be registered after reveal.js is already initialized. ### Retrieving Plugins -If you want to check if a specific plugin is registered you can use the `Reveal.hasPlugin` method and pass in a plugin ID, for example: `Reveal.hasPlugin( ’myPlugin’ )`. If you want to retrieve a plugin instance you can use `Reveal.getPlugin( ’myPlugin’ )`. +If you want to check if a specific plugin is registered you can use the `Reveal.hasPlugin` method and pass in a plugin ID, for example: `Reveal.hasPlugin( ’my-plugin’ )`. If you want to retrieve a plugin instance you can use `Reveal.getPlugin( ’my-plugin’ )`. ### Dependencies