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
26
Readme.org
26
Readme.org
|
@ -44,7 +44,7 @@
|
||||||
|
|
||||||
Extract Reveal.js folders from the downloaded zip file.
|
Extract Reveal.js folders from the downloaded zip file.
|
||||||
|
|
||||||
If you do not wish to download reveal.js yourself and would rather get a copy from a CDN,
|
If you do not wish to download reveal.js yourself and would rather get a copy from a CDN,
|
||||||
see the section [[Set the location of Reveal.js]]
|
see the section [[Set the location of Reveal.js]]
|
||||||
|
|
||||||
** Install org-reveal from MELPA
|
** Install org-reveal from MELPA
|
||||||
|
@ -296,7 +296,7 @@
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Title Slide Background Image
|
*** Title Slide Background Image
|
||||||
|
|
||||||
To set the title slide's background image, please specify the
|
To set the title slide's background image, please specify the
|
||||||
following options:
|
following options:
|
||||||
|
|
||||||
|
@ -328,15 +328,19 @@
|
||||||
From Reveal.js 3.1.0, slide numbering can have several custom
|
From Reveal.js 3.1.0, slide numbering can have several custom
|
||||||
formats. To choose one format, please set ~reveal_slide_number~ to
|
formats. To choose one format, please set ~reveal_slide_number~ to
|
||||||
its proper string. For example, ~reveal_slide_number:h/v~.
|
its proper string. For example, ~reveal_slide_number:h/v~.
|
||||||
|
|
||||||
Supported format string can be found in [[https://github.com/hakimel/reveal.js/#slide-number][Reveal.js manual]].
|
Supported format string can be found in [[https://github.com/hakimel/reveal.js/#slide-number][Reveal.js manual]].
|
||||||
|
|
||||||
|
|
||||||
** Slide Header/Footer
|
** Slide Header/Footer
|
||||||
Specify Slide header/footer by =#+REVEAL_SLIDE_HEADER:= and
|
Specify Slide header/footer by =#+REVEAL_SLIDE_HEADER:= and
|
||||||
=#+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
|
||||||
|
|
||||||
|
@ -348,7 +352,7 @@
|
||||||
Paragraphs can be fragmented.
|
Paragraphs can be fragmented.
|
||||||
|
|
||||||
#+ATTR_REVEAL: :frag roll-in
|
#+ATTR_REVEAL: :frag roll-in
|
||||||
- Lists can
|
- Lists can
|
||||||
- be fragmented.
|
- be fragmented.
|
||||||
|
|
||||||
#+ATTR_REVEAL: :frag roll-in
|
#+ATTR_REVEAL: :frag roll-in
|
||||||
|
@ -366,7 +370,7 @@
|
||||||
* highlight-blue
|
* highlight-blue
|
||||||
* appear
|
* appear
|
||||||
|
|
||||||
Setting ~:frag t~ will use Reveal.js default fragment style, which
|
Setting ~:frag t~ will use Reveal.js default fragment style, which
|
||||||
can be overridden by local option ~#+REVEAL_DEFAULT_FRAG_STYLE~ or
|
can be overridden by local option ~#+REVEAL_DEFAULT_FRAG_STYLE~ or
|
||||||
global variable ~org-reveal-default-frag-style~.
|
global variable ~org-reveal-default-frag-style~.
|
||||||
|
|
||||||
|
@ -473,9 +477,9 @@
|
||||||
1. Use your Emacs theme
|
1. Use your Emacs theme
|
||||||
2. Use highlight.js
|
2. Use highlight.js
|
||||||
|
|
||||||
|
|
||||||
To Use your Emacs theme, please make sure ~htmlize.el~ is
|
To Use your Emacs theme, please make sure ~htmlize.el~ is
|
||||||
installed. Then no more setup is necessary.
|
installed. Then no more setup is necessary.
|
||||||
|
|
||||||
Below is an example. Codes are copied from [[http://www.haskell.org/haskellwiki/The_Fibonacci_sequence][Haskell Wiki]].
|
Below is an example. Codes are copied from [[http://www.haskell.org/haskellwiki/The_Fibonacci_sequence][Haskell Wiki]].
|
||||||
#+BEGIN_SRC haskell
|
#+BEGIN_SRC haskell
|
||||||
|
@ -489,7 +493,7 @@
|
||||||
*** Using highlight.js
|
*** Using highlight.js
|
||||||
|
|
||||||
You can also use [[https://highlightjs.org][highlight.js]], by adding ~highlight~ to the Reveal.js
|
You can also use [[https://highlightjs.org][highlight.js]], by adding ~highlight~ to the Reveal.js
|
||||||
plugin list.
|
plugin list.
|
||||||
#+BEGIN_SRC org
|
#+BEGIN_SRC org
|
||||||
,#+REVEAL_PLUGINS: (highlight)
|
,#+REVEAL_PLUGINS: (highlight)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
@ -497,7 +501,7 @@
|
||||||
The default highlighting theme is ~zenburn.css~ brought with
|
The default highlighting theme is ~zenburn.css~ brought with
|
||||||
Reveal.js. To use other themes, please specify the CSS file name by
|
Reveal.js. To use other themes, please specify the CSS file name by
|
||||||
~#+REVEAL_HIGHLIGHT_CSS~ or the variable ~org-reveal-highlight-css~.
|
~#+REVEAL_HIGHLIGHT_CSS~ or the variable ~org-reveal-highlight-css~.
|
||||||
|
|
||||||
The "%r" in the given CSS file name will be replaced by Reveal.js'
|
The "%r" in the given CSS file name will be replaced by Reveal.js'
|
||||||
URL.
|
URL.
|
||||||
|
|
||||||
|
@ -663,7 +667,7 @@
|
||||||
Reveal.js scripts will be embedded into the exported HTML file, to make
|
Reveal.js scripts will be embedded into the exported HTML file, to make
|
||||||
a portable HTML. Please note that remote images will /not/ be included in the
|
a portable HTML. Please note that remote images will /not/ be included in the
|
||||||
single file, so presentations with remote images will still require an Internet
|
single file, so presentations with remote images will still require an Internet
|
||||||
connection.
|
connection.
|
||||||
|
|
||||||
Attention: This needs locally available reveal.js files!
|
Attention: This needs locally available reveal.js files!
|
||||||
|
|
||||||
|
|
44
ox-reveal.el
44
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
|
||||||
|
@ -540,7 +554,7 @@ using custom variable `org-reveal-root'."
|
||||||
|
|
||||||
;; Include CSS for highlight.js if necessary
|
;; Include CSS for highlight.js if necessary
|
||||||
(if (org-reveal--using-highlight.js info)
|
(if (org-reveal--using-highlight.js info)
|
||||||
(format "<link rel=\"stylesheet\" href=\"%s\"/>"
|
(format "<link rel=\"stylesheet\" href=\"%s\"/>"
|
||||||
(format-spec (plist-get info :reveal-highlight-css)
|
(format-spec (plist-get info :reveal-highlight-css)
|
||||||
`((?r . ,(directory-file-name root-path))))))
|
`((?r . ,(directory-file-name root-path))))))
|
||||||
;; print-pdf
|
;; print-pdf
|
||||||
|
@ -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