output_format_dependency {rmarkdown} | R Documentation |
Define the dependency such as and pre/post-processors dynamically from
within chunks. This function shares some arguments with
output_format
, but lacks the others because dependency
is resolved after post_knit
and before pre_processor
.
output_format_dependency(
name,
pandoc = list(),
pre_processor = NULL,
post_processor = NULL,
file_scope = NULL,
on_exit = NULL
)
name |
A dependency name. If some dependencies share the same name, then only the first one will be attached. |
pandoc |
Pandoc options for an output format (see
|
pre_processor |
An optional pre-processor function that receives the
|
post_processor |
An optional post-processor function that receives the
|
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 bookdown does), and those files may need to
processed by pandoc using the |
on_exit |
A function to call when |
An list of arguments with the "rmd_dependency" class.
# Add lua filters from within a chunk
output_format_dependency("lua_filter", pre_processor = function(...) {
pandoc_lua_filter_args(c("example1.lua", "example2.lua"))
})