Merge pull request #4 from junkka/revealjs3
Themes and transitions
diff --git a/R/revealjs_presentation.R b/R/revealjs_presentation.R
index 61cda17..e16e6d3 100644
--- a/R/revealjs_presentation.R
+++ b/R/revealjs_presentation.R
@@ -80,6 +80,7 @@
self_contained = TRUE,
theme = "default",
transition = "default",
+ background_transition = "default",
highlight = "default",
mathjax = "default",
template = "default",
@@ -128,6 +129,10 @@
transition <- match.arg(transition, revealjs_transitions())
args <- c(args, "--variable", paste("transition=", transition, sep=""))
+ # background_transition
+ background_transition <- match.arg(background_transition, revealjs_transitions())
+ args <- c(args, "--variable", paste("background_transition=", background_transition, sep=""))
+
# content includes
args <- c(args, includes_to_pandoc_args(includes))
@@ -182,22 +187,25 @@
"beige",
"serif",
"solarized",
- "dark",
"blood",
"moon",
- "night")
+ "night",
+ "black",
+ "league",
+ "white")
}
revealjs_transitions <- function() {
- c("default",
- "cube",
- "page",
- "concave",
- "zoom",
- "linear",
+ c(
+ "default",
+ "none",
"fade",
- "none")
+ "slide",
+ "convex",
+ "concave",
+ "zoom"
+ )
}
diff --git a/inst/rmarkdown/templates/revealjs_presentation/default.html b/inst/rmarkdown/templates/revealjs_presentation/default.html
index f1a473f..ecbcbc2 100644
--- a/inst/rmarkdown/templates/revealjs_presentation/default.html
+++ b/inst/rmarkdown/templates/revealjs_presentation/default.html
@@ -12,7 +12,7 @@
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
<link rel="stylesheet" href="$revealjs-url$/css/reveal.min.css"/>
<!-- some tweaks to reveal css -->
@@ -96,15 +96,13 @@
<link rel="stylesheet" href="$css$"/>
$endfor$
$endif$
- <!-- If the query includes 'print-pdf', include the PDF print sheet -->
+ <!-- Printing and PDF exports -->
<script>
- if( window.location.search.match( /print-pdf/gi ) ) {
- var link = document.createElement( 'link' );
- link.rel = 'stylesheet';
- link.type = 'text/css';
- link.href = '$revealjs-url$/css/print/pdf.css';
- document.getElementsByTagName( 'head' )[0].appendChild( link );
- }
+ var link = document.createElement( 'link' );
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
+ document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
<!--[if lt IE 9]>
<script src="$revealjs-url$/lib/js/html5shiv.js"></script>
@@ -159,7 +157,8 @@
history: true,
center: $if(center)$true$else$false$endif$,
transition: '$transition$',
-
+ backgroundTransition: '$background_transition$',
+
// Optional libraries used to extend on reveal.js
dependencies: []});
</script>