Fixed #480, merge custom theme with REVEAL_THEME

This commit is contained in:
Yujie Wen 2022-11-27 15:01:04 +08:00
parent 0dc6d4f1dd
commit 2d5a04ddec
2 changed files with 10 additions and 6 deletions

View File

@ -279,10 +279,12 @@
Theme is set globally throughout the whole file by setting option
=REVEAL_THEME=.
Available themes can be found in "css/theme/" in the reveal.js directory.
Available themes can be found in ~dist/theme~ in the reveal.js
directory and can be select by giving the CSS file base name (without
.css extension) to =REVEAL_THEME=.
Custom themes can be implemented by setting =REVEAL_THEME= to =custom= and
then setting =REVEAL_THEME_CUSTOM= to the path for a theme CSS file.
A custom theme CSS can be also set by giving its URL to
~REVEAL_THEME~.
Slide transition style is set by initialization option ~transition~
and the transition speed is set by ~transitionSpeed~ . Please refer to

View File

@ -60,7 +60,6 @@
(:reveal-trans "REVEAL_TRANS" nil nil t)
(:reveal-speed "REVEAL_SPEED" nil nil t)
(:reveal-theme "REVEAL_THEME" nil org-reveal-theme t)
(:reveal-theme-custom "REVEAL_THEME_CUSTOM" nil nil nil)
(:reveal-extra-css "REVEAL_EXTRA_CSS" nil org-reveal-extra-css newline)
(:reveal-extra-js "REVEAL_EXTRA_JS" nil org-reveal-extra-js nil)
(:reveal-extra-initial-js "REVEAL_EXTRA_INITIAL_JS" nil org-reveal-extra-initial-js newline)
@ -651,8 +650,11 @@ using custom variable `org-reveal-root'."
(version (org-reveal--get-reveal-js-version info))
(reveal-css (org-reveal--choose-path root-path version "dist/reveal.css" "css/reveal.css"))
(theme (plist-get info :reveal-theme))
(theme-css (if (string-equal "custom" (downcase theme))
(plist-get info :reveal-theme-custom)
(theme-css (if (or (string-prefix-p "http://" theme)
(string-prefix-p "https://" theme)
(string-prefix-p "file://" theme))
;; theme is just the URL to a custom theme CSS
theme
(org-reveal--choose-path root-path
version
(concat "dist/theme/" theme ".css")