output_format
Define an R Markdown output format
Define an R Markdown output format based on a combination of knitr and pandoc options.
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, base_format = NULL)
Arguments
- knitr
Knitr options for an output format (see
knitr_options
)- pandoc
Pandoc options for an output format (see
pandoc_options
)- keep_md
Keep the markdown file generated by knitting. Note that if this is
TRUE
thenclean_supporting
will always beFALSE
.- clean_supporting
Cleanup any supporting files after conversion see
render_supporting_files
- df_print
Method to be used for printing data frames. Valid values include "default", "kable", "tibble", and "paged". The "default" method uses
print.data.frame
. The "kable" method uses theknitr::kable
function. The "tibble" method uses the 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 thedf_print
behavior entirely by setting the optionrmarkdown.df_print
toFALSE
.- pre_knit
An optional function that runs before knitting which receives the
input
(input filename passed torender
) and...
(for future expansion) arguments.- post_knit
An optional function that runs after knitting which receives the
metadata
,input_file
,runtime
, and...
(for future expansion) arguments. This function can return additional arguments to pass to pandoc and can callknitr::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.- pre_processor
An optional pre-processor function that receives the
metadata
,input_file
,runtime
,knit_meta
,files_dir
, andoutput_dir
and can return additional arguments to pass to pandoc.- intermediates_generator
An optional function that receives the original
input_file
, itsencoding
, and the intermediates directory (i.e. theintermediates_dir
argument torender
). The function should generate and return the names of any intermediate files required to render theinput_file
.- post_processor
An optional post-processor function that receives the
metadata
,input_file
,output_file
,clean
, andverbose
parameters, and can return an alternativeoutput_file
.- on_exit
A function to call when
rmarkdown::render()
finishes execution (as registered with aon.exit
handler).- base_format
An optional format to extend.
Value
An R Markdown output format definition that can be passed to
render
.
See Also
Examples
# NOT RUN {
output_format(knitr = knitr_options(opts_chunk = list(dev = 'png')),
pandoc = pandoc_options(to = "html"))
# }