Convert md to HTML5 reveal.js

Usage

reveal.js(theme = "default", transition = "default", in.file = NULL, out.dir = path,
  ref.page = "References", refs.cex = 15, path = file.path(getwd(), "PRESENTATION"),
      figure.dir = "figure", hi.cex = 25)

Arguments

theme
possible reveal.js themes: c("sky", "beige", "simple", "serif", "night", "default").
transition
possible reveal.js transitions: c("default", "cube", "page", "concave", "zoom", "linear", "fade", "none").
in.file
A character vector of the md file.
out.dir
A character vector of the out directory. Default uses the root name and outputs to a directory called reveal_js.
ref.page
The title of the reference page (adds hanging indent and reduces font size). If NULL references slide will not be adjusted. If reference title is not found a warning will print.
refs.cex
The font size to make the references.
path
The path to where the documents reside. Default is the PRESENTATION directory. This conveniently allows for non paths to be supplied to in.file and out.file. Paths can be supplied to in.file and out.file by setting path to NULL.
figure.dir
The name of the figures directory where figures are stored. This should be in the presentation folder. By default it is called figure.
hi.cex
The font size to make the hanging indent coded text if hi code chunk is used.

Description

Uses http://johnmacfarlane.net/pandoc/ to convert md to HTML5 reveal.js slides and provides minor modifications (e.g., embedded youtube and hanging indent text, etc.).

Details

Outputs a directory, revel_js, with an index.html and necessary reveal.js files. The user must have Pandoc installed and on their path. Pandoc can be installed from: http://johnmacfarlane.net/pandoc/installing.html

Code Chunks

The following convenience code chunks are implemented:

  1. bg- - Place after a slide title to change background color. Currently takes bg-soothe, bg-blackout, bg-alert, red , orange , yellow , green , blue , indigo , violet , or brown .
  2. frag- - Using a dash/space (- ) has the usual effect of text appearing however special effects can be applied to text by using the dash/space followed by the text and followed by [[[]]]=frag- and last a fragment style. Valid styles include: grow, shrink, roll-in, fade-out, highlight-red, highlight-green, or highlight-blue.
  3. hi - Wrapping text with this code chunk will result in hanging indentation. Use hi.cex to control the font size of the text.
  4. notes - Wrap presenter notes that work when slides are uploaded to the Internet. Press "s" to get the speaker notes window.
  5. small - Wrap text to produce small font.
  6. sud & eud- Wrap a group of slides to give the nested up and down capabilities. start-up-down (sud) goes directly above the beginning side in the .Rmd file, end-up-down (eud) goes directly at the end of the last slide in the nested group, however there should be a space between text and this code tag.
  7. yt - Wrap a youtube url or tag to embed a youtube video.
Code chunks use the following form: [[[text]]]=code.tag (e.g., [[[cokNUTGtoM4]]]=yt embeds a youtube video. Currently this is a convenience feature that may have unexpected results and may need additional tweaking within the html output. When using embedded youtube, slide titles and text are ignored but may effect the spacing of the player. User additions are welcomed.

reports based code chunks are for convenience. For more control many HTML tags work with Rmarkdown. The output code can also be manipulated for finer control.

Examples

## Not run: # #Run after running knitr on an Rmd file# reveal.js() #assumes location of html file out of the box# # # An example .Rmd file can be found:# system.file("extdata/docs/example.Rmd", package = "reports")# ## End(Not run)

See also

html5