mirror of https://github.com/yjwen/org-reveal.git
Fixed #465. Add option for including script source files.
This commit is contained in:
parent
a78ca48a33
commit
2adca68b2b
13
Readme.org
13
Readme.org
|
@ -803,15 +803,22 @@ This feature is turned off by default and needs to be switched on with ~org-reve
|
||||||
.html file. Provide your audience with a link to the client file to allow
|
.html file. Provide your audience with a link to the client file to allow
|
||||||
them to track your presentation on their own device.
|
them to track your presentation on their own device.
|
||||||
|
|
||||||
** Extra Stylesheets
|
** Extra Stylesheets and Script Sources
|
||||||
|
|
||||||
Set =REVEAL_EXTRA_CSS= to a stylesheet file path in order to load extra custom
|
Set =REVEAL_EXTRA_CSS= to a stylesheet file path to load extra custom
|
||||||
styles after loading a theme.
|
styles after loading a theme.
|
||||||
|
|
||||||
|
Set =REVEAL_EXTRA_SCRIPT_SRC` to script file path to load extra
|
||||||
|
script sources.
|
||||||
|
|
||||||
#+BEGIN_SRC org
|
#+BEGIN_SRC org
|
||||||
,#+REVEAL_EXTRA_CSS: url-to-custom-stylesheet.css
|
,#+REVEAL_EXTRA_CSS: url-to-custom-stylesheet.css
|
||||||
|
,#+REVEAL_EXTRA_SCRIPT_SRC: url-to-custom-script
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Same setup can be done globally by customize variables
|
||||||
|
~org-reveal-extra-css~ and ~org-reveal-extra-script-src~.
|
||||||
|
|
||||||
** Select Built-In Scripts
|
** Select Built-In Scripts
|
||||||
|
|
||||||
Set option =REVEAL_PLUGINS= or variable =org-reveal-plugins= to a
|
Set option =REVEAL_PLUGINS= or variable =org-reveal-plugins= to a
|
||||||
|
|
13
ox-reveal.el
13
ox-reveal.el
|
@ -100,6 +100,7 @@
|
||||||
(:reveal-default-frag-style "REVEAL_DEFAULT_FRAG_STYLE" nil org-reveal-default-frag-style 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-single-file nil "reveal_single_file" org-reveal-single-file t)
|
||||||
(:reveal-extra-script "REVEAL_EXTRA_SCRIPT" nil org-reveal-extra-script space)
|
(:reveal-extra-script "REVEAL_EXTRA_SCRIPT" nil org-reveal-extra-script space)
|
||||||
|
(:reveal-extra-script-src "REVEAL_EXTRA_SCRIPT_SRC" nil org-reveal-extra-script-src split)
|
||||||
(:reveal-init-options "REVEAL_INIT_OPTIONS" nil org-reveal-init-options newline)
|
(:reveal-init-options "REVEAL_INIT_OPTIONS" nil org-reveal-init-options newline)
|
||||||
(:reveal-highlight-css "REVEAL_HIGHLIGHT_CSS" nil org-reveal-highlight-css nil)
|
(:reveal-highlight-css "REVEAL_HIGHLIGHT_CSS" nil org-reveal-highlight-css nil)
|
||||||
(:reveal-reveal-js-version "REVEAL_REVEAL_JS_VERSION" nil nil t)
|
(:reveal-reveal-js-version "REVEAL_REVEAL_JS_VERSION" nil nil t)
|
||||||
|
@ -319,6 +320,11 @@ Example:
|
||||||
:group 'org-export-reveal
|
:group 'org-export-reveal
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom org-reveal-extra-script-src '()
|
||||||
|
"Custom script source that will be embedded in a <script src> tag."
|
||||||
|
:group 'org-export-reveal
|
||||||
|
:type 'list)
|
||||||
|
|
||||||
(defcustom org-reveal-highlight-css "%r/lib/css/zenburn.css"
|
(defcustom org-reveal-highlight-css "%r/lib/css/zenburn.css"
|
||||||
"Highlight.js CSS file."
|
"Highlight.js CSS file."
|
||||||
:group 'org-export-reveal
|
:group 'org-export-reveal
|
||||||
|
@ -813,7 +819,12 @@ Reveal.initialize({
|
||||||
",\n")
|
",\n")
|
||||||
;; Extra initialization scripts
|
;; Extra initialization scripts
|
||||||
(or (plist-get info :reveal-extra-script) "")))
|
(or (plist-get info :reveal-extra-script) "")))
|
||||||
)))
|
;; Extra <script src="..."></script> tags
|
||||||
|
(let ((src-list (plist-get info :reveal-extra-script-src)))
|
||||||
|
(and src-list
|
||||||
|
(mapconcat (lambda (src) (format "<script src=\"%s\"></script>" src))
|
||||||
|
src-list
|
||||||
|
"\n"))))))
|
||||||
|
|
||||||
(defun org-reveal--read-sexps-from-string (s)
|
(defun org-reveal--read-sexps-from-string (s)
|
||||||
(let ((s (string-trim s)))
|
(let ((s (string-trim s)))
|
||||||
|
|
Loading…
Reference in New Issue