diff --git a/Readme.org b/Readme.org index 61ab37c..b704cba 100644 --- a/Readme.org +++ b/Readme.org @@ -178,6 +178,64 @@ $ git clone https://github.com/yjwen/org-reveal.git Available transitions are: default|cube|page|concave|zoom|linear|fade|none. +** Set Slide Background + + Slide background can be set to a color, an image or a repeating image + array by setting heading properties. + +*** Single Colored Background + :PROPERTIES: + :reveal_background: #543210 + :END: + + Set property =reveal_background= to either an RGB color value, or any + supported CSS color format. + +#+BEGIN_SRC org +,*** Single Colored Background + :PROPERTIES: + :reveal_background: #123456 + :END: +#+END_SRC + +*** Single Image Background + :PROPERTIES: + :reveal_background: ./images/whale.jpg + :reveal_background_trans: slide + :END: + + Set property =reveal_background= to an URL of background image. + Set property =reveal_background_trans= to =slide= to make background image + sliding rather than fading. +#+BEGIN_SRC org +,*** Single Image Background + :PROPERTIES: + :reveal_background: ./images/whale.jpg + :reveal_background_trans: slide + :END: +#+END_SRC + +*** Repeating Image Background + :PROPERTIES: + :reveal_background: ./images/whale.jpg + :reveal_background_size: 200px + :reveal_background_repeat: repeat + :END: + + Resize background image by setting property + =reveal_background_size= to a number. + + Set property =reveal_background_repeat= to =repeat= to repeat + image on the background. +#+BEGIN_SRC org +,*** Repeating Image Background + :PROPERTIES: + :reveal_background: ./images/whale.jpg + :reveal_background_size: 200px + :reveal_background_repeat: repeat + :END: +#+END_SRC + ** Slide Size Reveal.js scales slides to best fit the display resolution. But in case diff --git a/images/whale.jpg b/images/whale.jpg new file mode 100755 index 0000000..2a3970d Binary files /dev/null and b/images/whale.jpg differ diff --git a/ox-reveal.el b/ox-reveal.el index ca0d736..5867950 100644 --- a/ox-reveal.el +++ b/ox-reveal.el @@ -277,12 +277,16 @@ holding contextual information." ;; into vertical ones. "
\n") ;; Start a new slide. - (format "
\n" + (format "
\n" (or (org-element-property :CUSTOM_ID headline) (concat "sec-" (mapconcat 'number-to-string (org-export-get-headline-number headline info) "-"))) - (if-format " data-state=\"%s\"" (org-element-property :REVEAL_DATA_STATE headline))) + (if-format " data-state=\"%s\"" (org-element-property :REVEAL_DATA_STATE headline)) + (if-format " data-background=\"%s\"" (org-element-property :REVEAL_BACKGROUND headline)) + (if-format " data-background-size=\"%s\"" (org-element-property :REVEAL_BACKGROUND_SIZE headline)) + (if-format " data-background-repeat=\"%s\"" (org-element-property :REVEAL_BACKGROUND_REPEAT headline)) + (if-format " data-background-transition=\"%s\"" (org-element-property :REVEAL_BACKGROUND_TRANS headline))) ;; The HTML content of this headline. (format "\n%s\n" level1