Fixed #479. Removed multiplex from plugin list.

This commit is contained in:
Yujie Wen 2022-05-23 20:59:28 +08:00
parent 862b41df77
commit bb3e4dbed9
2 changed files with 22 additions and 18 deletions

View File

@ -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_ID: [Obtained from the socket.io server. ]
,#+REVEAL_MULTIPLEX_SECRET: [Obtained from socket.io server. Gives the master control of the presentation.] ,#+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_MULTIPLEX_URL: https://reveal-multiplex.glitch.me [Location of socket.io server]
,#+REVEAL_PLUGINS: ([any other plugins you are using] multiplex)
#+END_SRC #+END_SRC
If your are using Reveal.js 3.x, an extra option is necessary for If your are using Reveal.js 3.x, an extra option is necessary for

View File

@ -808,26 +808,27 @@ custom variable `org-reveal-root'."
(init-options (plist-get info :reveal-init-options)) (init-options (plist-get info :reveal-init-options))
(multiplex-statement (multiplex-statement
;; multiplexing - depends on defvar 'client-multiplex' ;; multiplexing - depends on defvar 'client-multiplex'
(when (memq 'multiplex plugins) (let ((multiplex-id (plist-get info :reveal-multiplex-id)))
(concat (when multiplex-id ;Multiplex setup found
(format "multiplex: { (concat
(format "multiplex: {
secret: %s, // null if client secret: %s, // null if client
id: '%s', // id, obtained from socket.io server id: '%s', // id, obtained from socket.io server
url: '%s' // Location of socket.io server url: '%s' // Location of socket.io server
},\n" },\n"
(if (eq client-multiplex nil) (if (eq client-multiplex nil)
(format "'%s'" (plist-get info :reveal-multiplex-secret)) (format "'%s'" (plist-get info :reveal-multiplex-secret))
(format "null")) (format "null"))
(plist-get info :reveal-multiplex-id) multiplex-id
(plist-get info :reveal-multiplex-url)) (plist-get info :reveal-multiplex-url))
(let ((url (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 } ]" (format "dependencies: [ { src: '%s/socket.io/socket.io.js', async: true }, { src: '%s/%s', async: true } ]"
url url url url
(if client-multiplex "client.js" (if client-multiplex "client.js"
(progn (progn
(setq client-multiplex t) (setq client-multiplex t)
"master.js"))))) "master.js")))))
)) )))
(extra-initial-js-statement (plist-get info :reveal-extra-initial-js)) (extra-initial-js-statement (plist-get info :reveal-extra-initial-js))
(legacy-dependency-statement (legacy-dependency-statement
(unless (or in-single-file (eq version 4)) (unless (or in-single-file (eq version 4))
@ -949,7 +950,11 @@ Reveal.initialize({
;; Second value of the tuple, a list of Reveal plugin ;; Second value of the tuple, a list of Reveal plugin
;; initialization statements ;; initialization statements
(format "plugins: [%s]" (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 ;; No available plugin info found. Perhaps wrong plugin
;; names are given ;; names are given
(cons nil nil))) (cons nil nil)))