% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rnw2rmd.R
\name{rnw2rmd}
\alias{rnw2rmd}
\title{Convert vognettes from *.Rnw to *.Rmd}
\usage{
rnw2rmd(
  file,
  output = "rmarkdown::html_vignette",
  output_options = c(toc = "true"),
  engine = "knitr::rmarkdown",
  csl = NULL,
  eval = FALSE,
  replace = NULL,
  flattr_id = NULL,
  write_file = FALSE,
  overwrite = FALSE
)
}
\arguments{
\item{file}{Path to an *.Rnw file to convert.}

\item{output}{Character string defining the R markdown output format.}

\item{output_options}{A named character vector with additional options. If you need
more than the default indentaion, you have to provide it directly (see default
values for \code{toc_float}).}

\item{engine}{Character string defining the \code{VignetteEngine} value.}

\item{csl}{Character string defining a CSL style file for the bibliography.
Please note that you will have to provide an existing file of that name in an
appropriate location, like the *.Rmd file's directory. Ignored if \code{NULL},
or if no bibliography was detected.}

\item{eval}{Logical, a default value for all R code chunks that are found. This is
like a safety net to be able to disable all code by default. Setting the default
value will be omitted if set to \code{NULL}.}

\item{replace}{An optional list of named character vectors with regular expressions
to do custom replacements in the text body. The list must contain vectors with
two character elements named \code{from} and \code{to}, to define what expressions
should be replaced and with what.}

\item{flattr_id}{Character string, the ID value of your Flattr meta tag. If set will be
added to the header of the resulting HTML file of the vignette.}

\item{write_file}{Logical, if set to \code{TRUE} results will be written to a file in
the same directory as the input \code{file}, but with *.Rmd file ending. Default is
\code{FALSE}, meaning results are returned as a character string.}

\item{overwrite}{Logical,
      whether existing files should be overwritten if \code{write_file=TRUE}.}
}
\description{
This is a much enhanced R port of Perl code gists from GitHub [1, 2].
It tries its best to convert old Sweave vignettes into R markdown.
Please do not expect it to do wonders, but to give you a good starting point
for conversions.
}
\examples{
\dontrun{
rnw2rmd(file.path(find.package("roxyPackage"),"doc","roxyPackage_vignette.Rnw"))

# use a fancy theme (not so good for CRAN, bloats the HTML file)
rnw2rmd(
  file.path(find.package("roxyPackage"),"doc","roxyPackage_vignette.Rnw"),
  output="html_document",
  output_options=c(
    theme="cerulean",
    highlight="kate",
    toc="true",
    toc_float="\n      collapsed: false\n      smooth_scroll: false",
    toc_depth=3
  )
)
}
}
\references{
[1] https://gist.github.com/mikelove/5618f935ace6e389d3fbac03224860cd

 [2] https://gist.github.com/lgatto/d9d0e3afcc0a4417e5084e5ca46a4d9e
}
