mirror of https://github.com/yjwen/org-reveal.git
Merge pull request #251 from stvol/master
add global header/footer support
This commit is contained in:
commit
05d107b7ec
|
@ -337,6 +337,10 @@
|
||||||
=#+REVEAL_SLIDE_FOOTER:=. The option content will be put into
|
=#+REVEAL_SLIDE_FOOTER:=. The option content will be put into
|
||||||
divisions of class =slide-header= and =slide-footer=, so you can
|
divisions of class =slide-header= and =slide-footer=, so you can
|
||||||
control their appearance in custom CSS file(see [[Extra Stylesheets]]).
|
control their appearance in custom CSS file(see [[Extra Stylesheets]]).
|
||||||
|
By default header/footer content will only display on content
|
||||||
|
slides. To show them also on the title and toc slide you can add
|
||||||
|
~reveal_global_header:t~ and ~reveal_global_footer:t~ to
|
||||||
|
~#+OPTIONS:~ line.
|
||||||
|
|
||||||
** Fragmented Contents
|
** Fragmented Contents
|
||||||
|
|
||||||
|
|
42
ox-reveal.el
42
ox-reveal.el
|
@ -64,6 +64,8 @@
|
||||||
(:reveal-extra-js "REVEAL_EXTRA_JS" nil org-reveal-extra-js nil)
|
(:reveal-extra-js "REVEAL_EXTRA_JS" nil org-reveal-extra-js nil)
|
||||||
(:reveal-hlevel "REVEAL_HLEVEL" nil nil t)
|
(:reveal-hlevel "REVEAL_HLEVEL" nil nil t)
|
||||||
(:reveal-title-slide nil "reveal_title_slide" org-reveal-title-slide t)
|
(:reveal-title-slide nil "reveal_title_slide" org-reveal-title-slide t)
|
||||||
|
(:reveal-slide-global-header nil "reveal_global_header" org-reveal-global-header t)
|
||||||
|
(:reveal-slide-global-footer nil "reveal_global_footer" org-reveal-global-footer t)
|
||||||
(:reveal-title-slide-background "REVEAL_TITLE_SLIDE_BACKGROUND" nil nil 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-size "REVEAL_TITLE_SLIDE_BACKGROUND_SIZE" nil nil t)
|
||||||
(:reveal-title-slide-background-position "REVEAL_TITLE_SLIDE_BACKGROUND_POSITION" nil nil t)
|
(:reveal-title-slide-background-position "REVEAL_TITLE_SLIDE_BACKGROUND_POSITION" nil nil t)
|
||||||
|
@ -296,6 +298,18 @@ content."
|
||||||
:group 'org-export-reveal
|
:group 'org-export-reveal
|
||||||
:type 'string)
|
:type 'string)
|
||||||
|
|
||||||
|
(defcustom org-reveal-global-header nil
|
||||||
|
"If non nil, slide header defined in org-reveal-slide-header
|
||||||
|
is displayed also on title and toc slide"
|
||||||
|
:group 'org-export-reveal
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
|
(defcustom org-reveal-global-footer nil
|
||||||
|
"If non nil, slide footer defined in org-reveal-slide-footer
|
||||||
|
is displayed also on title and toc slide"
|
||||||
|
:group 'org-export-reveal
|
||||||
|
:type 'boolean)
|
||||||
|
|
||||||
(defcustom org-reveal-slide-footer nil
|
(defcustom org-reveal-slide-footer nil
|
||||||
"HTML content used as Reveal.js slide footer"
|
"HTML content used as Reveal.js slide footer"
|
||||||
:group 'org-export-reveal
|
:group 'org-export-reveal
|
||||||
|
@ -720,9 +734,18 @@ dependencies: [
|
||||||
(defun org-reveal-toc (depth info)
|
(defun org-reveal-toc (depth info)
|
||||||
"Build a slide of table of contents."
|
"Build a slide of table of contents."
|
||||||
(let ((toc (org-html-toc depth info)))
|
(let ((toc (org-html-toc depth info)))
|
||||||
(if toc
|
(when toc
|
||||||
(format "<section id=\"table-of-contents\">\n%s</section>\n"
|
(let ((toc-slide-with-header (plist-get info :reveal-slide-global-header))
|
||||||
(replace-regexp-in-string "<a href=\"#" "<a href=\"#/slide-" toc)))))
|
(toc-slide-with-footer (plist-get info :reveal-slide-global-footer)))
|
||||||
|
(concat "<section id=\"table-of-contents\">\n"
|
||||||
|
(when toc-slide-with-header
|
||||||
|
(let ((header (plist-get info :reveal-slide-header)))
|
||||||
|
(when header (format "<div class=\"slide-header\">%s</div>\n" header))))
|
||||||
|
(replace-regexp-in-string "<a href=\"#" "<a href=\"#/slide-" toc)
|
||||||
|
(when toc-slide-with-footer
|
||||||
|
(let ((footer (plist-get info :reveal-slide-footer)))
|
||||||
|
(when footer (format "<div class=\"slide-footer\">%s</div>\n" footer))))
|
||||||
|
"</section>\n")))))
|
||||||
|
|
||||||
(defun org-reveal-inner-template (contents info)
|
(defun org-reveal-inner-template (contents info)
|
||||||
"Return body of document string after HTML conversion.
|
"Return body of document string after HTML conversion.
|
||||||
|
@ -1044,7 +1067,9 @@ info is a plist holding export options."
|
||||||
(title-slide-background-size (plist-get info :reveal-title-slide-background-size))
|
(title-slide-background-size (plist-get info :reveal-title-slide-background-size))
|
||||||
(title-slide-background-position (plist-get info :reveal-title-slide-background-position))
|
(title-slide-background-position (plist-get info :reveal-title-slide-background-position))
|
||||||
(title-slide-background-repeat (plist-get info :reveal-title-slide-background-repeat))
|
(title-slide-background-repeat (plist-get info :reveal-title-slide-background-repeat))
|
||||||
(title-slide-background-transition (plist-get info :reveal-title-slide-background-transition)))
|
(title-slide-background-transition (plist-get info :reveal-title-slide-background-transition))
|
||||||
|
(title-slide-with-header (plist-get info :reveal-slide-global-header))
|
||||||
|
(title-slide-with-footer (plist-get info :reveal-slide-global-footer)))
|
||||||
(concat "<section id=\"sec-title-slide\""
|
(concat "<section id=\"sec-title-slide\""
|
||||||
(when title-slide-background
|
(when title-slide-background
|
||||||
(concat " data-background=\"" title-slide-background "\""))
|
(concat " data-background=\"" title-slide-background "\""))
|
||||||
|
@ -1057,10 +1082,17 @@ info is a plist holding export options."
|
||||||
(when title-slide-background-transition
|
(when title-slide-background-transition
|
||||||
(concat " data-background-transition=\"" title-slide-background-transition "\""))
|
(concat " data-background-transition=\"" title-slide-background-transition "\""))
|
||||||
">"
|
">"
|
||||||
|
(when title-slide-with-header
|
||||||
|
(let ((header (plist-get info :reveal-slide-header)))
|
||||||
|
(when header (format "<div class=\"slide-header\">%s</div>\n" header))))
|
||||||
(cond ((eq title-slide nil) nil)
|
(cond ((eq title-slide nil) nil)
|
||||||
((stringp title-slide) (format-spec title-slide (org-html-format-spec info)))
|
((stringp title-slide) (format-spec title-slide (org-html-format-spec info)))
|
||||||
((eq title-slide 'auto) (org-reveal--auto-title-slide-template info)))
|
((eq title-slide 'auto) (org-reveal--auto-title-slide-template info)))
|
||||||
"\n</section>\n"))))
|
"\n"
|
||||||
|
(when title-slide-with-footer
|
||||||
|
(let ((footer (plist-get info :reveal-slide-footer)))
|
||||||
|
(when footer (format "<div class=\"slide-footer\">%s</div>\n" footer))))
|
||||||
|
"</section>\n"))))
|
||||||
contents
|
contents
|
||||||
"</div>
|
"</div>
|
||||||
</div>\n"
|
</div>\n"
|
||||||
|
|
Loading…
Reference in New Issue