% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/output_format.R
\name{output_format}
\alias{output_format}
\title{Define an R Markdown output format}
\usage{
output_format(
  knitr,
  pandoc,
  keep_md = FALSE,
  clean_supporting = TRUE,
  df_print = NULL,
  pre_knit = NULL,
  post_knit = NULL,
  pre_processor = NULL,
  intermediates_generator = NULL,
  post_processor = NULL,
  on_exit = NULL,
  file_scope = NULL,
  base_format = NULL
)
}
\arguments{
\item{knitr}{Knitr options for an output format (see
\code{\link{knitr_options}})}

\item{pandoc}{Pandoc options for an output format (see
\code{\link{pandoc_options}})}

\item{keep_md}{Keep the markdown file generated by knitting. Note that if
this is \code{TRUE} then \code{clean_supporting} will always be
\code{FALSE}.}

\item{clean_supporting}{Cleanup any supporting files after conversion see
\code{\link{render_supporting_files}}}

\item{df_print}{Method to be used for printing data frames. Valid values
include "default", "kable", "tibble", and "paged". The "default" method
uses a corresponding S3 method of \code{print}, typically
\code{print.data.frame}. The "kable" method uses the
\code{\link[knitr:kable]{knitr::kable}} function. The "tibble" method uses
the \pkg{tibble} package to print a summary of the data frame. The "paged"
method creates a paginated HTML table (note that this method is only valid
for formats that produce HTML). In addition to the named methods you can
also pass an arbitrary function to be used for printing data frames. You
can disable the \code{df_print} behavior entirely by setting the option
\code{rmarkdown.df_print} to \code{FALSE}. See
\href{https://bookdown.org/yihui/rmarkdown/html-document.html#data-frame-printing}{Data
frame printing section} in bookdown book for examples.}

\item{pre_knit}{An optional function that runs before knitting which receives
the \code{input} (input filename passed to \code{render}), \code{metadata}
(the parsed front matter of the Rmd file) and \code{...} (for future
expansion) arguments. This function can be used to add side effects before
knitting step.}

\item{post_knit}{An optional function that runs after knitting which receives
the \code{metadata}, \code{input_file}, \code{runtime}, and \code{...} (for
future expansion) arguments. This function can return additional arguments
to pass to pandoc and can call \code{knitr::knit_meta_add} to add
additional dependencies based on the contents of the input_file or on other
assets side by side with it that may be used to produce html with
dependencies during subsequent processing.}

\item{pre_processor}{An optional pre-processor function that receives the
\code{metadata}, \code{input_file}, \code{runtime}, \code{knit_meta},
\code{files_dir}, and \code{output_dir} and can return additional arguments
to pass to pandoc.}

\item{intermediates_generator}{An optional function that receives the
original \code{input_file}, and the intermediates directory (i.e. the
\code{intermediates_dir} argument to \code{\link{render}}). The function
should generate and return the names of any intermediate files required to
render the \code{input_file}.}

\item{post_processor}{An optional post-processor function that receives the
\code{metadata}, \code{input_file}, \code{output_file}, \code{clean}, and
\code{verbose} parameters, and can return an alternative
\code{output_file}.}

\item{on_exit}{A function to call when \code{rmarkdown::render()} finishes
execution (as registered with a \code{\link{on.exit}} handler).}

\item{file_scope}{A function that will split markdown input to pandoc into
multiple named files. This is useful when the caller has concatenated a set
of Rmd files together (as \pkg{bookdown} does), and those files may need to
processed by pandoc using the \code{--file-scope} option. The first
argument is input file paths and the second is \code{NULL} or current file
scope which is a named list of files w/ \code{name} and \code{content} for
each file. The return is the new file scope. Also, the arguments should
include \code{...} for the future extensions.}

\item{base_format}{An optional format to extend.}
}
\value{
An R Markdown output format definition that can be passed to
  \code{\link{render}}.
}
\description{
Define an R Markdown output format based on a combination of knitr and pandoc
options.
}
\examples{
\dontrun{
output_format(knitr = knitr_options(opts_chunk = list(dev = 'png')),
              pandoc = pandoc_options(to = "html"))
}
}
\seealso{
\link{render}, \link{knitr_options}, \link{pandoc_options}
}
