summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/org-reveal-config.el12
-rw-r--r--tests/test-org-reveal-config-header-template.el14
2 files changed, 16 insertions, 10 deletions
diff --git a/modules/org-reveal-config.el b/modules/org-reveal-config.el
index 3ab80315..9dfbb99a 100644
--- a/modules/org-reveal-config.el
+++ b/modules/org-reveal-config.el
@@ -33,7 +33,7 @@
(defconst cj/reveal-default-theme "black"
"Default reveal.js theme for new presentations.")
-(defconst cj/reveal-default-transition "slide"
+(defconst cj/reveal-default-transition "none"
"Default reveal.js slide transition for new presentations.")
;; --------------------------------- ox-reveal ---------------------------------
@@ -45,7 +45,10 @@
(setq org-reveal-single-file t)
(setq org-reveal-plugins '(highlight notes search zoom))
(setq org-reveal-highlight-css "%r/plugin/highlight/monokai.css")
- (setq org-reveal-init-options "slideNumber:true, hash:true"))
+ (setq org-reveal-init-options (format "slideNumber:true, hash:true, transition:'%s'"
+ cj/reveal-default-transition))
+ (setq org-reveal-head-preamble
+ "<style>.reveal h1,.reveal h2,.reveal h3,.reveal p{text-transform:none;}</style>"))
;; ----------------------------- Private Helpers -------------------------------
@@ -58,11 +61,10 @@
#+DATE: %s
#+REVEAL_ROOT: %s
#+REVEAL_THEME: %s
-#+REVEAL_TRANS: %s
-#+REVEAL_INIT_OPTIONS: slideNumber:true, hash:true
+#+REVEAL_INIT_OPTIONS: slideNumber:true, hash:true, transition:'%s'
#+REVEAL_PLUGINS: (highlight notes search zoom)
#+REVEAL_HIGHLIGHT_CSS: %%r/plugin/highlight/monokai.css
-#+OPTIONS: toc:nil num:nil
+#+OPTIONS: toc:nil num:nil date:nil timestamp:nil author:t
" title (user-full-name) (format-time-string "%Y-%m-%d")
(concat "file://" cj/reveal-root)
diff --git a/tests/test-org-reveal-config-header-template.el b/tests/test-org-reveal-config-header-template.el
index 11939c55..df1db9e7 100644
--- a/tests/test-org-reveal-config-header-template.el
+++ b/tests/test-org-reveal-config-header-template.el
@@ -59,10 +59,10 @@
result))))
(ert-deftest test-org-reveal-config-header-template-normal-contains-transition ()
- "Output should contain #+REVEAL_TRANS: with the default transition."
+ "Output should contain transition in INIT_OPTIONS with the default value."
(let ((result (test-reveal--header "My Talk")))
(should (string-match-p
- (format "^#\\+REVEAL_TRANS: %s$" cj/reveal-default-transition)
+ (format "transition:'%s'" cj/reveal-default-transition)
result))))
(ert-deftest test-org-reveal-config-header-template-normal-contains-init-options ()
@@ -85,9 +85,13 @@
(should (string-match-p "^#\\+REVEAL_HIGHLIGHT_CSS:.*monokai" result))))
(ert-deftest test-org-reveal-config-header-template-normal-contains-options ()
- "Output should contain #+OPTIONS: disabling toc and num."
+ "Output should contain #+OPTIONS: disabling toc, num, and date; enabling author."
(let ((result (test-reveal--header "My Talk")))
- (should (string-match-p "^#\\+OPTIONS: toc:nil num:nil$" result))))
+ (should (string-match-p "^#\\+OPTIONS:.*toc:nil" result))
+ (should (string-match-p "^#\\+OPTIONS:.*num:nil" result))
+ (should (string-match-p "^#\\+OPTIONS:.*date:nil" result))
+ (should (string-match-p "^#\\+OPTIONS:.*timestamp:nil" result))
+ (should (string-match-p "^#\\+OPTIONS:.*author:t" result))))
(ert-deftest test-org-reveal-config-header-template-normal-ends-with-blank-line ()
"Output should end with a trailing newline (blank line separator)."
@@ -98,7 +102,7 @@
"All required org keywords should be present in the output."
(let ((result (test-reveal--header "My Talk"))
(keywords '("#+TITLE:" "#+AUTHOR:" "#+DATE:"
- "#+REVEAL_ROOT:" "#+REVEAL_THEME:" "#+REVEAL_TRANS:"
+ "#+REVEAL_ROOT:" "#+REVEAL_THEME:"
"#+REVEAL_INIT_OPTIONS:" "#+REVEAL_PLUGINS:"
"#+REVEAL_HIGHLIGHT_CSS:" "#+OPTIONS:")))
(dolist (kw keywords)