export: Export a notebook to Markdown

Description Usage Arguments Value Examples

Description

Export a notebook file to Markdown (‘.md’) or R Markdown (‘.Rmd’).

Usage

1
export(file, output, raw = FALSE)

Arguments

file

the notebook filename

output

the output filename; by default, the filename is the input filename file with the file extension replaced by ‘.md’ (raw = FALSE) or ‘.Rmd’ (raw = TRUE)

raw

whether to export the notebook as raw R Markdown or only Markdown output; for the latter case, the notebook must have been compiled via refresh() beforehand

Value

The output filename is returned invisibly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
f = rnotebook::newnb()
rnotebook::refresh(f)  # compile the notebook
file.show(f)

f1 = rnotebook::export(f)  # export to markdown
file.edit(f1)

f2 = rnotebook::export(f, raw = TRUE)  # export to R Markdown
file.edit(f2)

unlink(c(f, f1, f2))

yihui/rnotebook documentation built on May 4, 2019, 4:26 p.m.