blob: 13fb59fa4643d838e4048befbe4784d2c9670f06 [file] [log] [blame]
JJ Allaired708ef02016-01-30 14:30:26 -05001% Generated by roxygen2: do not edit by hand
junkkad4b3a162015-03-16 07:49:11 +01002% Please edit documentation in R/revealjs_presentation.R
JJ Allaire2ec40242014-09-15 09:18:39 -04003\name{revealjs_presentation}
4\alias{revealjs_presentation}
5\title{Convert to a reveal.js presentation}
6\usage{
JJ Allaire4c178052016-01-30 19:35:39 -05007revealjs_presentation(incremental = FALSE, center = FALSE,
8 slide_level = 2, fig_width = 8, fig_height = 6, fig_retina = if
9 (!fig_caption) 2, fig_caption = FALSE, smart = TRUE,
10 self_contained = TRUE, theme = "simple", transition = "default",
11 background_transition = "default", reveal_options = NULL,
12 highlight = "default", mathjax = "default", template = "default",
13 css = NULL, includes = NULL, keep_md = FALSE, lib_dir = NULL,
14 pandoc_args = NULL, ...)
JJ Allaire2ec40242014-09-15 09:18:39 -040015}
16\arguments{
17\item{incremental}{\code{TRUE} to render slide bullets incrementally. Note
18that if you want to reverse the default incremental behavior for an
19individual bullet you can preceded it with \code{>}. For example:
20\emph{\code{> - Bullet Text}}}
21
22\item{center}{\code{TRUE} to vertically center content on slides}
23
JJ Allaire4c178052016-01-30 19:35:39 -050024\item{slide_level}{Level of heading to denote individual slides. If
25\code{slide_level} is 2 (the default), a two-dimensional layout will be
26produced, with level 1 headers building horizontally and level 2 headers
27building vertically. It is not recommended that you use deeper nesting of
28section levels with reveal.js.}
29
JJ Allaire2ec40242014-09-15 09:18:39 -040030\item{fig_width}{Default width (in inches) for figures}
31
32\item{fig_height}{Default width (in inches) for figures}
33
34\item{fig_retina}{Scaling to perform for retina displays (defaults to 2 when
35\code{fig_caption} is \code{FALSE}, which currently works for all widely
36used retina displays). Set to \code{NULL} to prevent retina scaling. Note
37that this will always be \code{NULL} when \code{keep_md} is specified (this
38is because \code{fig_retina} relies on outputting HTML directly into the
39markdown document).}
40
41\item{fig_caption}{\code{TRUE} to render figures with captions}
42
43\item{smart}{Produce typographically correct output, converting straight
44quotes to curly quotes, --- to em-dashes, -- to en-dashes, and ... to
45ellipses.}
46
47\item{self_contained}{Produce a standalone HTML file with no external
48dependencies, using data: URIs to incorporate the contents of linked
JJ Allaired708ef02016-01-30 14:30:26 -050049scripts, stylesheets, images, and videos. Note that even for self contained
50documents MathJax is still loaded externally (this is necessary because of
51it's size).}
JJ Allaire2ec40242014-09-15 09:18:39 -040052
JJ Allaire4c178052016-01-30 19:35:39 -050053\item{theme}{Visual theme ("simple", "sky", "beige", "serif", "solarized",
54"blood", "moon", "night", "black", "league" or "white").}
JJ Allaire2ec40242014-09-15 09:18:39 -040055
JJ Allaired708ef02016-01-30 14:30:26 -050056\item{transition}{Slide transition ("default", "none", "fade", "slide",
junkkad4b3a162015-03-16 07:49:11 +010057"convex", "concave" or "zoom")}
58
JJ Allaire4c178052016-01-30 19:35:39 -050059\item{background_transition}{Slide background-transition ("default", "none",
60"fade", "slide", "convex", "concave" or "zoom")}
JJ Allaire2ec40242014-09-15 09:18:39 -040061
JJ Allaire4c178052016-01-30 19:35:39 -050062\item{reveal_options}{Additional options to specify for reveal.js (see
63\href{https://github.com/hakimel/reveal.js#configuration}{https://github.com/hakimel/reveal.js#configuration}
64for details).}
JJ Allaire37f45b72016-01-30 18:17:45 -050065
JJ Allaire2ec40242014-09-15 09:18:39 -040066\item{highlight}{Syntax highlighting style. Supported styles include
67"default", "tango", "pygments", "kate", "monochrome", "espresso",
68"zenburn", and "haddock". Pass \code{NULL} to prevent syntax highlighting.}
69
70\item{mathjax}{Include mathjax. The "default" option uses an https URL from
71the official MathJax CDN. The "local" option uses a local version of
72MathJax (which is copied into the output directory). You can pass an
73alternate URL or pass \code{NULL} to exclude MathJax entirely.}
74
JJ Allaire4c178052016-01-30 19:35:39 -050075\item{template}{Pandoc template to use for rendering. Pass "default" to use
76the rmarkdown package default template; pass \code{NULL} to use pandoc's
77built-in template; pass a path to use a custom template that you've
78created. Note that if you don't use the "default" template then some
79features of \code{revealjs_presentation} won't be available (see the
80Templates section below for more details).}
JJ Allaire2ec40242014-09-15 09:18:39 -040081
JJ Allairefad55232015-10-19 07:47:26 -040082\item{css}{One or more css files to include}
83
JJ Allaire2ec40242014-09-15 09:18:39 -040084\item{includes}{Named list of additional content to include within the
85document (typically created using the \code{\link{includes}} function).}
86
87\item{keep_md}{Keep the markdown file generated by knitting.}
88
89\item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery,
90bootstrap, etc.) into. By default this will be the name of the document
91with \code{_files} appended to it.}
92
93\item{pandoc_args}{Additional command line options to pass to pandoc}
JJ Allaire8d1c2f42016-01-30 14:56:45 -050094
95\item{...}{Ignored}
JJ Allaire2ec40242014-09-15 09:18:39 -040096}
97\value{
98R Markdown output format to pass to \code{\link{render}}
99}
100\description{
101Format for converting from R Markdown to a reveal.js presentation.
102}
103\details{
JJ Allaire4c178052016-01-30 19:35:39 -0500104In reveal.js presentations you can use level 1 or level 2 headers for slides.
105If you use a mix of level 1 and level 2 headers then a two-dimensional layout
106will be produced, with level 1 headers building horizontally and level 2
107headers building vertically.
JJ Allaire2ec40242014-09-15 09:18:39 -0400108
JJ Allaire4c178052016-01-30 19:35:39 -0500109For additional documentation on using revealjs presentations see
110\href{https://github.com/rstudio/revealjs}{https://github.com/rstudio/revealjs}.
JJ Allaire2ec40242014-09-15 09:18:39 -0400111}
112\section{Templates}{
113
JJ Allaire4c178052016-01-30 19:35:39 -0500114
115 You can provide a custom HTML template to be used for rendering. The syntax
116 for templates is described in the documentation on
117 \href{http://johnmacfarlane.net/pandoc/demo/example9/templates.html}{pandoc
118 templates}. You can also use the basic pandoc template by passing
119 \code{template = NULL}.
120
121 Note however that if you choose not to use the "default" reveal.js template
122 then several aspects of reveal.js presentation rendering will behave
123 differently:
124
125 \itemize{ \item{The \code{center} parameter does not work (you'd need to
126 set this directly in the template). } \item{The built-in template includes
127 some additional tweaks to styles to optimize for output from R, these won't
128 be present. } \item{MathJax will not work if \code{self_contained} is
129 \code{TRUE} (these two options can't be used together in normal pandoc
130 templates). } }
JJ Allaire2ec40242014-09-15 09:18:39 -0400131}
132\examples{
133\dontrun{
134
135library(rmarkdown)
136library(revealjs)
137
138# simple invocation
139render("pres.Rmd", revealjs_presentation())
140
141# specify an option for incremental rendering
142render("pres.Rmd", revealjs_presentation(incremental = TRUE))
143}
JJ Allaired708ef02016-01-30 14:30:26 -0500144
145
JJ Allaire2ec40242014-09-15 09:18:39 -0400146}
147