html5: Convert md to HTML5 Slides

Description Usage Arguments Details Code Chunks Author(s) References See Also Examples

View source: R/html5.R

Description

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

Usage

1
2
3
  html5(in.file = NULL, out.file = NULL, type = "dzslides",
    ref.page = "References", refs.cex = 15,
    path = file.path(getwd(), "PRESENTATION"), hi.cex = 25)

Arguments

in.file

A character vector of the md file.

out.file

A character vector of the outfile. If "replace" over writes the original HTML file. Default, NULL, uses the root name of the in.file plus a number 2.

type

A character string of the desired slide type; either c("slidy" or "dzslides").

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/should be created. 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.

hi.cex

The font size to make the hanging indent coded text if hi code chunk is used.

Details

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. hi - Wrapping text with this code chunk will result in hanging indentation. Use hi.cex to control the font size of the text.

  2. 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.

Author(s)

Ananda Mahto & Tyler Rinker <tyler.rinker@gmail.com>

References

http://stackoverflow.com/a/14971683/1000343

See Also

reveal.js

Examples

1
2
3
4
5
## Not run: 
#Run after running knitr on an Rmd file
html5()  #assumes location of html file out of the box

## End(Not run)

reports documentation built on May 2, 2019, 8:29 a.m.