Add custom JS to reveal.initialize.

This commit is contained in:
Yujie Wen 2015-10-13 01:01:15 +08:00
parent 75fb814fb5
commit c36d736dc0
2 changed files with 15 additions and 2 deletions

View File

@ -639,6 +639,12 @@ fibs = 0 : 1 : next fibs
* [[Tips]].
* [[#my-heading][Heading]] with a =CUSTOM_ID= property.
** Custom JS
To pass custom JS code to ~Reveal.initialize~, state the code by
~#+REVEAL_INIT_SCRIPT~ (multiple statements are concatenated) or by
custom variable ~org-reveal-init-script~.
* Thanks
Courtesy to:

View File

@ -83,6 +83,7 @@
(:reveal-plugins "REVEAL_PLUGINS" nil nil t)
(:reveal-default-frag-style "REVEAL_DEFAULT_FRAG_STYLE" nil org-reveal-default-frag-style t)
(:reveal-single-file nil "reveal_single_file" org-reveal-single-file t)
(:reveal-init-script "REVEAL_INIT_SCRIPT" nil org-reveal-init-script space)
)
:translate-alist
@ -321,6 +322,11 @@ can contain the following escaping elements:
:group 'org-export-reveal
:type 'boolean)
(defcustom org-reveal-init-script nil
"Custom script that will be passed to Reveal.initialize."
:group 'org-export-reveal
:type 'string)
(defcustom org-reveal-note-key-char "n"
"If not nil, org-reveal-note-key-char's value is registered as
the key character to Org-mode's structure completion for
@ -655,8 +661,9 @@ dependencies: [
(append (list extra-codes) builtin-codes))))
(mapconcat 'identity total-codes ",\n"))
"]\n"
)
)
(let ((init-script (plist-get info :reveal-init-script)))
(if init-script (concat "," init-script)))
))
"});\n</script>\n")))
(defun org-reveal-toc (depth info)