forked from rstudio/rmarkdown
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput_format.Rd
105 lines (93 loc) · 4.02 KB
/
output_format.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
% 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}.}
\item{pre_knit}{An optional function that runs before knitting which receives
the \code{input} (input filename passed to \code{render}) and \code{...}
(for future expansion) arguments.}
\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 function
should return a named list of files w/ \code{name} and \code{content} for
each file.}
\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}
}