From 79b01ae85bccf3622dc79d17d3eceebfa9a81636 Mon Sep 17 00:00:00 2001 From: Yujie Wen Date: Sat, 26 Sep 2020 12:28:46 +0800 Subject: [PATCH] Fixed #429. Updated multiplexing exports with Reveal.js 4.x --- Readme.org | 31 +++++++++++++++++++------------ ox-reveal.el | 48 +++++++++++++++++++++++++++--------------------- 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/Readme.org b/Readme.org index 9c8cd99..df80add 100644 --- a/Readme.org +++ b/Readme.org @@ -743,20 +743,27 @@ This feature is turned off by default and needs to be switched on with ~org-reve 'n'. set it to nil will forbid the auto-completion for speaker notes. ** Multiplexing - Reveal.js supports multiplexing, which allows your audience to view - the slides of the presentation you are controlling on their own phone, tablet - or laptop. As the master presentation navigates the slides, all client - presentations will update in real time. See a demo at - http://revealjs.jit.su/. + Reveal.js supports a [[https://github.com/reveal/multiplex#multiplex-plugin][multiplexing plugin]], which allows your + audience to view the slides of the presentation you are controlling + on their own phone, tablet or laptop. As the master presentation + navigates the slides, all client presentations will update in real + time. See a demo at [[https://reveal-multiplex.glitch.me/]]. - You can enable multiplexing for your slide generation by including the - following options: + To use multiplexing, first prepare a Socket.io server by the + instruction [[https://github.com/reveal/multiplex#socketio-server][here]]. Then include the following options in the org + file. Contents in ~[]~ are commentary notes, not part of the + options. #+BEGIN_SRC org -#+REVEAL_MULTIPLEX_ID: [Obtained from the socket.io server. ] -#+REVEAL_MULTIPLEX_SECRET: [Obtained from socket.io server. Gives the master control of the presentation.] -#+REVEAL_MULTIPLEX_URL: http://revealjs.jit.su:80 [Location of socket.io server] -#+REVEAL_MULTIPLEX_SOCKETIO_URL: http://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js -#+REVEAL_PLUGINS: ([any other plugins you are using] multiplex) +,#+REVEAL_MULTIPLEX_ID: [Obtained from the socket.io server. ] +,#+REVEAL_MULTIPLEX_SECRET: [Obtained from socket.io server. Gives the master control of the presentation.] +,#+REVEAL_MULTIPLEX_URL: https://reveal-multiplex.glitch.me [Location of socket.io server] +,#+REVEAL_PLUGINS: ([any other plugins you are using] multiplex) +#+END_SRC + + If your are using Reveal.js 3.x, an extra option is necessary for + Socket.io scripts. +#+BEGIN_SRC org +,#+REVEAL_MULTIPLEX_SOCKETIO_URL: http://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js #+END_SRC You must generate unique values for the =REVEAL_MULTIPLEX_ID= and diff --git a/ox-reveal.el b/ox-reveal.el index 703b886..c36673c 100644 --- a/ox-reveal.el +++ b/ox-reveal.el @@ -754,6 +754,7 @@ dependencies: [ notes (format " { src: '%splugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }" root-path) search (format " { src: '%splugin/search/search.js', async: true, condition: function() { return !!document.body.classList; } }" root-path) remotes (format " { src: '%splugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }" root-path) + ;; multiplex setup for reveal.js 3.x multiplex (format " { src: '%s', async: true },\n%s" (plist-get info :reveal-multiplex-socketio-url) ; following ensures that either client.js or master.js is included depending on defva client-multiplex value state @@ -764,15 +765,24 @@ dependencies: [ (format " { src: '%splugin/multiplex/master.js', async: true }" root-path)) (format " { src: '%splugin/multiplex/client.js', async: true }" root-path))))) (builtin-codes - (if (eq version 4) - '() ;; For reveal.js 4.x, skip the builtin plug-in - ;; codes as they are for 3.x. The 4.x builtin - ;; plug-ins are specified by separate