decktape: Convert HTML presentations to PDF via DeckTape

Description Usage Arguments Value Note References Examples

View source: R/render.R

Description

This function can use either the decktape command or the hosted docker image of the decktape library to convert HTML slides to PDF (including slides produced by xaringan).

Usage

1
2
decktape(file, output, args = "--chrome-arg=--allow-file-access-from-files", 
    docker = Sys.which("decktape") == "", version = "", open = FALSE)

Arguments

file

The path to the HTML presentation file. When docker = FALSE, this path could be a URL to online slides.

output

The desired output path of the PDF file.

args

Command-line arguments to be passed to decktape.

docker

Whether to use Docker (TRUE) or use the decktape command directly (FALSE). By default, if decktape has been installed in your system and can be found via Sys.which('decktape'), it will be uesd directly.

version

The decktape version when you use Docker.

open

Whether to open the resulting PDF with your system PDF viewer.

Value

The output file path (invisibly).

Note

For some operating systems you may need to add yourself to the docker group and restart your machine if you use DeckTape via Docker. By default, the latest version of the decktape Docker image is used. In case of errors, you may want to try older versions (e.g., version = '2.8.0').

References

DeckTape: https://github.com/astefanutti/decktape. Docker: https://www.docker.com.

Examples

1
2
3
4
if (interactive()) {
    xaringan::decktape("https://slides.yihui.name/xaringan", "xaringan.pdf", 
        docker = FALSE)
}

yihui/xaringan documentation built on Dec. 14, 2018, 6:23 p.m.