Render the input file to the specified output format using quarto. If the input requires computations (e.g. for Rmd or Jupyter files) then those computations are performed before rendering.
quarto_render(
input = NULL,
output_format = NULL,
output_file = NULL,
execute = TRUE,
execute_params = NULL,
execute_dir = NULL,
execute_daemon = NULL,
execute_daemon_restart = FALSE,
execute_debug = FALSE,
use_freezer = FALSE,
cache = NULL,
cache_refresh = FALSE,
metadata = NULL,
metadata_file = NULL,
debug = FALSE,
quiet = FALSE,
profile = NULL,
quarto_args = NULL,
pandoc_args = NULL,
as_job = getOption("quarto.render_as_job", "auto")
)
The input file or project directory to be rendered (defaults to rendering the project in the current working directory).
Target output format (defaults to "html"
). The option
"all"
will render all formats defined within the file or project.
The name of the output file. If using NULL
, the output
filename will be based on the filename for the input file. output_file
is
mapped to the --output
option flag of the quarto
CLI. It is expected to
be a filename only, not a path, relative or absolute.
Whether to execute embedded code chunks.
A list of named parameters that override custom params specified within the YAML front-matter.
The working directory in which to execute embedded code chunks.
Keep Jupyter kernel alive (defaults to 300 seconds). Note this option is only applicable for rendering Jupyter notebooks or Jupyter markdown.
Restart keepalive Jupyter kernel before render. Note this option is only applicable for rendering Jupyter notebooks or Jupyter markdown.
Show debug output for Jupyter kernel.
Force use of frozen computations for an incremental file render.
Cache execution output (uses knitr cache and jupyter-cache respectively for Rmd and Jupyter input files).
Force refresh of execution cache.
An optional named list used to override YAML
metadata. It will be passed as a YAML file to --metadata-file
CLI flag.
This will be merged over metadata-file
options if both are
specified.
A yaml file passed to --metadata-file
CLI flags to
override metadata. This will be merged with metadata
if both are
specified, with low precedence on metadata
options.
Leave intermediate files in place after render.
Suppress warning and other messages.
Quarto project profile(s) to use. Either
a character vector of profile names or NULL
to use the default profile.
Character vector of other quarto
CLI arguments to append
to the Quarto command executed by this function. This is mainly intended for
advanced usage and useful for CLI arguments which are not yet mirrored in a
dedicated parameter of this R function. See quarto render --help
for options.
Additional command line arguments to pass on to Pandoc.
Render as an RStudio background job. Default is "auto"
,
which will render individual documents normally and projects as
background jobs. Use the quarto.render_as_job
R option to control
the default globally.
if (FALSE) {
# Render R Markdown
quarto_render("notebook.Rmd")
quarto_render("notebook.Rmd", output_format = "pdf")
# Render Jupyter Notebook
quarto_render("notebook.ipynb")
# Render Jupyter Markdown
quarto_render("notebook.md")
# Override metadata
quarto_render("notebook.Rmd", metadata = list(lang = "fr", execute = list(echo = FALSE)))
}
Run the code above in your browser using DataLab