knit2wp {knitr} | R Documentation |
This function is a wrapper around the RWordPress package. It compiles an R Markdown document to HTML and post the results to WordPress.
knit2wp(input, title = "A post from knitr", ..., envir = parent.frame(), shortcode = FALSE, action = c("newPost", "editPost", "newPage"), postid, encoding = getOption("encoding"), publish = TRUE)
input |
the filename of the Rmd document |
title |
the post title |
... |
other meta information of the post, e.g. |
envir |
the environment in which the code chunks are to be evaluated
(for example, |
shortcode |
a logical vector of length 2: whether to use the shortcode
[sourcecode lang='lang'] which can be useful to WordPress.com users
for syntax highlighting of source code and output; the first element
applies to source code, and the second applies to text output (by default,
both are |
action |
to create a new post, update an existing post, or create a new page |
postid |
if action is |
encoding |
the encoding of the input file; see |
publish |
whether to publish the post immediately |
This function will convert the encoding of the post and the title to
UTF-8 internally. If you have additional data to send to WordPress (e.g.
keywords and categories), you may have to manually convert them to the
UTF-8 encoding with the iconv(x, to = 'UTF-8')
function
(especially when using Windows).
William K. Morris, Yihui Xie, and Jared Lander
http://yihui.name/knitr/demo/wordpress/
# see the reference