Skip to content

Commit

Permalink
add background support.
Browse files Browse the repository at this point in the history
  • Loading branch information
yjwen committed Aug 12, 2013
1 parent 430f01c commit 525a554
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 2 deletions.
58 changes: 58 additions & 0 deletions Readme.org
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added images/whale.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions ox-reveal.el
Original file line number Diff line number Diff line change
Expand Up @@ -277,12 +277,16 @@ holding contextual information."
;; into vertical ones.
"<section>\n")
;; Start a new slide.
(format "<section id=\"%s\" %s>\n"
(format "<section id=\"%s\" %s%s%s%s%s>\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<h%d%s>%s</h%d>\n"
level1
Expand Down

0 comments on commit 525a554

Please sign in to comment.