From bb3e4dbed9ef0feb41e9c6c5acfd75975ecafce5 Mon Sep 17 00:00:00 2001 From: Yujie Wen Date: Mon, 23 May 2022 20:59:28 +0800 Subject: [PATCH] Fixed #479. Removed multiplex from plugin list. --- Readme.org | 1 - ox-reveal.el | 39 ++++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/Readme.org b/Readme.org index 8380acd..6b1fd90 100644 --- a/Readme.org +++ b/Readme.org @@ -794,7 +794,6 @@ This feature is turned off by default and needs to be switched on with ~org-reve ,#+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 diff --git a/ox-reveal.el b/ox-reveal.el index c71e42f..d161d6d 100644 --- a/ox-reveal.el +++ b/ox-reveal.el @@ -808,26 +808,27 @@ custom variable `org-reveal-root'." (init-options (plist-get info :reveal-init-options)) (multiplex-statement ;; multiplexing - depends on defvar 'client-multiplex' - (when (memq 'multiplex plugins) - (concat - (format "multiplex: { + (let ((multiplex-id (plist-get info :reveal-multiplex-id))) + (when multiplex-id ;Multiplex setup found + (concat + (format "multiplex: { secret: %s, // null if client id: '%s', // id, obtained from socket.io server url: '%s' // Location of socket.io server },\n" - (if (eq client-multiplex nil) - (format "'%s'" (plist-get info :reveal-multiplex-secret)) - (format "null")) - (plist-get info :reveal-multiplex-id) - (plist-get info :reveal-multiplex-url)) - (let ((url (plist-get info :reveal-multiplex-url))) - (format "dependencies: [ { src: '%s/socket.io/socket.io.js', async: true }, { src: '%s/%s', async: true } ]" - url url - (if client-multiplex "client.js" - (progn - (setq client-multiplex t) - "master.js"))))) -)) + (if (eq client-multiplex nil) + (format "'%s'" (plist-get info :reveal-multiplex-secret)) + (format "null")) + multiplex-id + (plist-get info :reveal-multiplex-url)) + (let ((url (plist-get info :reveal-multiplex-url))) + (format "dependencies: [ { src: '%s/socket.io/socket.io.js', async: true }, { src: '%s/%s', async: true } ]" + url url + (if client-multiplex "client.js" + (progn + (setq client-multiplex t) + "master.js"))))) + ))) (extra-initial-js-statement (plist-get info :reveal-extra-initial-js)) (legacy-dependency-statement (unless (or in-single-file (eq version 4)) @@ -949,7 +950,11 @@ Reveal.initialize({ ;; Second value of the tuple, a list of Reveal plugin ;; initialization statements (format "plugins: [%s]" - (mapconcat 'symbol-name plugins ", "))) + (mapconcat 'symbol-name + ;; Remove multiplex from plugins, as + ;; the multiplex plugin has been moved + ;; out of reveal.js. + (seq-filter (lambda (p) (not (eq p 'multiplex))) plugins) ", "))) ;; No available plugin info found. Perhaps wrong plugin ;; names are given (cons nil nil)))