From 4a778f8f1c6e02a5c2035280ad7c668ae412b251 Mon Sep 17 00:00:00 2001 From: Yujie Wen Date: Wed, 4 Feb 2015 00:36:54 +0800 Subject: [PATCH] Add title slide background image --- Readme.org | 9 +++++++++ ox-reveal.el | 20 ++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/Readme.org b/Readme.org index e12fca8..6337ae6 100755 --- a/Readme.org +++ b/Readme.org @@ -259,6 +259,15 @@ $ git clone https://github.com/yjwen/org-reveal.git :END: #+END_SRC +*** Title Slide Background Image + + To set the title slide's background image, please specify the + following options: + + * =REVEAL_TITLE_SLIDE_BACKGROUND=: A URL to the background image. + * =REVEAL_TITLE_SLIDE_BACKGROUND_SIZE=: HTML size specification, e.g. ~200px~. + * =REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT=: set to ~repeat~ to repeat the image. + ** Slide Size Reveal.js scales slides to best fit the display resolution, but you can diff --git a/ox-reveal.el b/ox-reveal.el index 7ea7055..ab36844 100755 --- a/ox-reveal.el +++ b/ox-reveal.el @@ -64,6 +64,10 @@ (:reveal-hlevel "REVEAL_HLEVEL" nil nil t) (:reveal-title-slide nil "reveal_title_slide" org-reveal-title-slide t) (:reveal-title-slide-template "REVEAL_TITLE_SLIDE_TEMPLATE" nil org-reveal-title-slide-template t) + (:reveal-title-slide-background "REVEAL_TITLE_SLIDE_BACKGROUND" nil nil t) + (:reveal-title-slide-background-size "REVEAL_TITLE_SLIDE_BACKGROUND_SIZE" nil nil t) + (:reveal-title-slide-background-repeat "REVEAL_TITLE_SLIDE_BACKGROUND_REPEAT" nil nil t) + (:reveal-title-slide-background-repeat "REVEAL_TITLE_SLIDE_BACKGROUND_TRANSITION" nil nil t) (:reveal-mathjax nil "reveal_mathjax" org-reveal-mathjax t) (:reveal-mathjax-url "REVEAL_MATHJAX_URL" nil org-reveal-mathjax-url t) (:reveal-preamble "REVEAL_PREAMBLE" nil org-reveal-preamble t) @@ -812,10 +816,18 @@ info is a plist holding export options." "
\n" (if (plist-get info :reveal-title-slide) - (concat - "
\n" - (format-spec (plist-get info :reveal-title-slide-template) (org-html-format-spec info)) - "\n
\n") + (concat + (format "
\n" + (if-format " data-background=\"%s\"" + (plist-get info :reveal-title-slide-background)) + (if-format " data-background-size=\"%s\"" + (plist-get info :reveal-title-slide-background-size)) + (if-format " data-background-repeat=\"%s\"" + (plist-get info :reveal-title-slide-background-repeat)) + (if-format " data-background-transition=\"%s\"" + (plist-get info :reveal-title-slide-background-transition))) + (format-spec (plist-get info :reveal-title-slide-template) (org-html-format-spec info)) + "\n
\n") "") contents "