JJ Allaire | d708ef0 | 2016-01-30 14:30:26 -0500 | [diff] [blame] | 1 | % Generated by roxygen2: do not edit by hand |
junkka | d4b3a16 | 2015-03-16 07:49:11 +0100 | [diff] [blame] | 2 | % Please edit documentation in R/revealjs_presentation.R |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 3 | \name{revealjs_presentation} |
| 4 | \alias{revealjs_presentation} |
| 5 | \title{Convert to a reveal.js presentation} |
| 6 | \usage{ |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 7 | revealjs_presentation( |
| 8 | incremental = FALSE, |
| 9 | center = FALSE, |
| 10 | slide_level = 2, |
Christophe Dervieux | aa008e4 | 2021-09-23 16:52:37 +0200 | [diff] [blame] | 11 | toc = FALSE, |
| 12 | toc_depth = 3, |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 13 | fig_width = 8, |
| 14 | fig_height = 6, |
| 15 | fig_retina = if (!fig_caption) 2, |
| 16 | fig_caption = FALSE, |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 17 | self_contained = TRUE, |
| 18 | theme = "simple", |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 19 | transition = "convex", |
| 20 | background_transition = "fade", |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 21 | reveal_options = NULL, |
| 22 | reveal_plugins = NULL, |
| 23 | highlight = "default", |
| 24 | mathjax = "default", |
| 25 | template = "default", |
| 26 | css = NULL, |
| 27 | includes = NULL, |
| 28 | keep_md = FALSE, |
| 29 | lib_dir = NULL, |
| 30 | pandoc_args = NULL, |
| 31 | extra_dependencies = NULL, |
| 32 | md_extensions = NULL, |
| 33 | ... |
| 34 | ) |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 35 | } |
| 36 | \arguments{ |
| 37 | \item{incremental}{\code{TRUE} to render slide bullets incrementally. Note |
| 38 | that if you want to reverse the default incremental behavior for an |
JJ Allaire | 2915275 | 2016-03-08 15:06:38 -0500 | [diff] [blame] | 39 | individual bullet you can precede it with \code{>}. For example: |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 40 | \emph{\verb{> - Bullet Text}}. See more in |
| 41 | \href{https://pandoc.org/MANUAL.html#incremental-lists}{Pandoc's Manual}} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 42 | |
| 43 | \item{center}{\code{TRUE} to vertically center content on slides} |
| 44 | |
JJ Allaire | 4c17805 | 2016-01-30 19:35:39 -0500 | [diff] [blame] | 45 | \item{slide_level}{Level of heading to denote individual slides. If |
| 46 | \code{slide_level} is 2 (the default), a two-dimensional layout will be |
| 47 | produced, with level 1 headers building horizontally and level 2 headers |
| 48 | building vertically. It is not recommended that you use deeper nesting of |
| 49 | section levels with reveal.js.} |
| 50 | |
Christophe Dervieux | aa008e4 | 2021-09-23 16:52:37 +0200 | [diff] [blame] | 51 | \item{toc}{\code{TRUE} to include a table of contents in the output (only |
| 52 | level 1 headers will be included in the table of contents).} |
| 53 | |
| 54 | \item{toc_depth}{Depth of headers to include in table of contents} |
| 55 | |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 56 | \item{fig_width}{Default width (in inches) for figures} |
| 57 | |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 58 | \item{fig_height}{Default height (in inches) for figures} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 59 | |
JJ Allaire | 82a8dee | 2016-07-12 10:25:36 -0400 | [diff] [blame] | 60 | \item{fig_retina}{Scaling to perform for retina displays (defaults to 2, which |
| 61 | currently works for all widely used retina displays). Set to \code{NULL} to |
| 62 | prevent retina scaling. Note that this will always be \code{NULL} when |
| 63 | \code{keep_md} is specified (this is because \code{fig_retina} relies on |
| 64 | outputting HTML directly into the markdown document).} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 65 | |
| 66 | \item{fig_caption}{\code{TRUE} to render figures with captions} |
| 67 | |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 68 | \item{self_contained}{Whether to generate a full LaTeX document (\code{TRUE}) |
| 69 | or just the body of a LaTeX document (\code{FALSE}). Note the LaTeX |
| 70 | document is an intermediate file unless \code{keep_tex = TRUE}.} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 71 | |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 72 | \item{theme}{Visual theme ("simple", "dark", "black", "sky", "beige", "serif", "solarized", "blood", "moon", "night", "league", or "white")} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 73 | |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 74 | \item{transition}{Slide transition ( |
| 75 | "convex", "fade", "slide", "concave", "zoom", or "none" |
| 76 | )} |
junkka | d4b3a16 | 2015-03-16 07:49:11 +0100 | [diff] [blame] | 77 | |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 78 | \item{background_transition}{Slide background-transition ( |
| 79 | "convex", "fade", "slide", "concave", "zoom", or "none" |
| 80 | )} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 81 | |
JJ Allaire | 35c0b49 | 2017-02-10 09:30:24 -0500 | [diff] [blame] | 82 | \item{reveal_options}{Additional options to specify for reveal.js (see |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 83 | \url{https://revealjs.com/config/} for details). Options for plugins can also |
| 84 | be passed, using plugin name as first level key (e.g \code{list(slideNumber = FALSE, menu = list(number = TRUE))}).} |
JJ Allaire | 37f45b7 | 2016-01-30 18:17:45 -0500 | [diff] [blame] | 85 | |
JJ Allaire | 35c0b49 | 2017-02-10 09:30:24 -0500 | [diff] [blame] | 86 | \item{reveal_plugins}{Reveal plugins to include. Available plugins include |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 87 | "notes", "search", "zoom", "chalkboard", and "menu". Note that |
JJ Allaire | 35c0b49 | 2017-02-10 09:30:24 -0500 | [diff] [blame] | 88 | \code{self_contained} must be set to \code{FALSE} in order to use Reveal |
| 89 | plugins.} |
JJ Allaire | 82a8dee | 2016-07-12 10:25:36 -0400 | [diff] [blame] | 90 | |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 91 | \item{highlight}{Syntax highlighting style passed to Pandoc. |
| 92 | |
| 93 | Supported built-in styles include "default", "tango", "pygments", "kate", |
| 94 | "monochrome", "espresso", "zenburn", "haddock", and "breezedark". |
| 95 | |
| 96 | Two custom styles are also included, "arrow", an accessible color scheme, |
| 97 | and "rstudio", which mimics the default IDE theme. Alternatively, supply a |
| 98 | path to a \samp{.theme} file to use |
| 99 | \href{https://pandoc.org/MANUAL.html#syntax-highlighting}{a custom Pandoc |
| 100 | style}. Note that custom theme requires Pandoc 2.0+. |
| 101 | |
| 102 | Pass \code{NULL} to prevent syntax highlighting.} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 103 | |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 104 | \item{mathjax}{Include mathjax. The "default" option uses an https URL from a |
| 105 | MathJax CDN. The "local" option uses a local version of MathJax (which is |
| 106 | copied into the output directory). You can pass an alternate URL or pass |
| 107 | \code{NULL} to exclude MathJax entirely.} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 108 | |
JJ Allaire | 4c17805 | 2016-01-30 19:35:39 -0500 | [diff] [blame] | 109 | \item{template}{Pandoc template to use for rendering. Pass "default" to use |
| 110 | the rmarkdown package default template; pass \code{NULL} to use pandoc's |
| 111 | built-in template; pass a path to use a custom template that you've |
| 112 | created. Note that if you don't use the "default" template then some |
| 113 | features of \code{revealjs_presentation} won't be available (see the |
| 114 | Templates section below for more details).} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 115 | |
Christophe Dervieux | 21239cf | 2021-09-15 15:34:01 +0200 | [diff] [blame] | 116 | \item{css}{CSS and/or Sass files to include. Files with an extension of .sass |
| 117 | or .scss are compiled to CSS via \code{sass::sass()}. Also, if \code{theme} is a |
| 118 | \code{\link[bslib:bs_theme]{bslib::bs_theme()}} object, Sass code may reference the relevant Bootstrap |
| 119 | Sass variables, functions, mixins, etc.} |
JJ Allaire | fad5523 | 2015-10-19 07:47:26 -0400 | [diff] [blame] | 120 | |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 121 | \item{includes}{Named list of additional content to include within the |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 122 | document (typically created using the \code{\link[rmarkdown]{includes}} function).} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 123 | |
| 124 | \item{keep_md}{Keep the markdown file generated by knitting.} |
| 125 | |
| 126 | \item{lib_dir}{Directory to copy dependent HTML libraries (e.g. jquery, |
JJ Allaire | 091cb12 | 2016-02-09 13:04:23 -0500 | [diff] [blame] | 127 | bootstrap, etc.) into. By default this will be the name of the document with |
| 128 | \code{_files} appended to it.} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 129 | |
| 130 | \item{pandoc_args}{Additional command line options to pass to pandoc} |
JJ Allaire | 8d1c2f4 | 2016-01-30 14:56:45 -0500 | [diff] [blame] | 131 | |
JJ Allaire | 35c0b49 | 2017-02-10 09:30:24 -0500 | [diff] [blame] | 132 | \item{extra_dependencies}{Additional function arguments to pass to the base R |
| 133 | Markdown HTML output formatter \code{\link[rmarkdown:html_document_base]{rmarkdown::html_document_base()}}.} |
JJ Allaire | 375805c | 2016-11-15 08:56:43 -0500 | [diff] [blame] | 134 | |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 135 | \item{md_extensions}{Markdown extensions to be added or removed from the |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 136 | default definition of R Markdown. See the \code{\link[rmarkdown]{rmarkdown_format}} for |
Atsushi Yasumoto | 7053f45 | 2020-02-15 00:08:46 +0900 | [diff] [blame] | 137 | additional details.} |
| 138 | |
JJ Allaire | 8d1c2f4 | 2016-01-30 14:56:45 -0500 | [diff] [blame] | 139 | \item{...}{Ignored} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 140 | } |
| 141 | \value{ |
christophe dervieux | d26add3 | 2021-09-23 16:55:00 +0200 | [diff] [blame] | 142 | R Markdown output format to pass to \code{\link[rmarkdown:render]{rmarkdown::render()}} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 143 | } |
| 144 | \description{ |
| 145 | Format for converting from R Markdown to a reveal.js presentation. |
| 146 | } |
| 147 | \details{ |
JJ Allaire | 4c17805 | 2016-01-30 19:35:39 -0500 | [diff] [blame] | 148 | In reveal.js presentations you can use level 1 or level 2 headers for slides. |
| 149 | If you use a mix of level 1 and level 2 headers then a two-dimensional layout |
| 150 | will be produced, with level 1 headers building horizontally and level 2 |
| 151 | headers building vertically. |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 152 | |
JJ Allaire | 4c17805 | 2016-01-30 19:35:39 -0500 | [diff] [blame] | 153 | For additional documentation on using revealjs presentations see |
christophe dervieux | d26add3 | 2021-09-23 16:55:00 +0200 | [diff] [blame] | 154 | \url{https://github.com/rstudio/revealjs} |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 155 | } |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 156 | \section{About plugins}{ |
| 157 | \subsection{Built-in plugins with reveal.js}{ |
| 158 | \subsection{Zoom}{ |
| 159 | |
| 160 | When activated, ALT + Click can be used to zoom on a slide. |
| 161 | } |
| 162 | |
| 163 | \subsection{Notes}{ |
| 164 | |
| 165 | Show a \href{https://revealjs.com/speaker-view/}{speaker view} in a separated |
| 166 | window. This speaker view contains a timer, current slide, next slide, and |
| 167 | speaker notes. It also duplicate the window to have presentation mode |
| 168 | synchronized with main presentation. |
| 169 | |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 170 | Use |
| 171 | |
| 172 | \if{html}{\out{<div class="sourceCode markdown">}}\preformatted{::: notes |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 173 | Content of speaker notes |
| 174 | ::: |
| 175 | }\if{html}{\out{</div>}} |
| 176 | |
| 177 | to create notes only viewable in presentation mode. |
| 178 | } |
| 179 | |
| 180 | \subsection{Search}{ |
| 181 | |
| 182 | When opt-in, it is possible to show a search box when pressing \code{CTRL + SHIFT + F}. It will seach in the whole presentation, and highlight matched words. The |
| 183 | matches will also be highlighted in overview mode (pressing ESC to see all |
| 184 | slides in one scrollable view) |
| 185 | } |
| 186 | |
| 187 | } |
| 188 | |
| 189 | \subsection{Menu}{ |
| 190 | |
| 191 | A slideout menu plugin for Reveal.js to quickly jump to any slide by title. |
| 192 | |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 193 | Version is |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 194 | currently used and documentation for configurations can be found at |
| 195 | \href{https://github.com/denehyg/reveal.js-menu/blob/2.1.0/README.md}{denehyg/reveal.js-menu} |
| 196 | \subsection{Known limitations}{ |
| 197 | |
| 198 | Some configurations cannot be modified in the current template: |
| 199 | \itemize{ |
| 200 | \item \code{loadIcons: false} the fontawesome icons are loaded by \pkg{rmarkdown} |
| 201 | when this plugin is used |
| 202 | \item \code{custom: false} |
| 203 | \item \code{themes: false} |
| 204 | \item \code{transitions: false} |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | } |
| 209 | |
| 210 | \subsection{Chalkboard}{ |
| 211 | |
| 212 | A plugin adding a chalkboard and slide annotation |
| 213 | |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 214 | Version is |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 215 | currently used and documentation for configurations can be found at |
| 216 | \href{https://github.com/rajgoel/reveal.js-plugins/tree/4.1.5/4.1.5/chalkboard}{rajgoel/reveal.js-plugins} |
| 217 | |
| 218 | By default, chalkboard and annotations modes will be accessible using keyboard |
| 219 | shortcuts, respectively, pressing B, or pressing C. |
Christophe Dervieux | 3778209 | 2023-03-24 17:36:16 +0100 | [diff] [blame^] | 220 | In addition, buttons on the bottom left can be added by using the following |
| 221 | |
| 222 | \if{html}{\out{<div class="sourceCode yaml">}}\preformatted{reveal_plugins: |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 223 | - chalkboard |
| 224 | reveal_options: |
| 225 | chalkboard: |
| 226 | toggleNotesButton: true |
| 227 | toggleChalkboardButton: true |
| 228 | }\if{html}{\out{</div>}} |
| 229 | } |
| 230 | } |
| 231 | |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 232 | \examples{ |
| 233 | \dontrun{ |
| 234 | |
| 235 | library(rmarkdown) |
| 236 | library(revealjs) |
| 237 | |
| 238 | # simple invocation |
| 239 | render("pres.Rmd", revealjs_presentation()) |
| 240 | |
| 241 | # specify an option for incremental rendering |
| 242 | render("pres.Rmd", revealjs_presentation(incremental = TRUE)) |
| 243 | } |
JJ Allaire | d708ef0 | 2016-01-30 14:30:26 -0500 | [diff] [blame] | 244 | |
JJ Allaire | 2ec4024 | 2014-09-15 09:18:39 -0400 | [diff] [blame] | 245 | } |