From e640dea7d38fcf219ea850f8f5a80646cdccc791 Mon Sep 17 00:00:00 2001 From: Salim B Date: Wed, 4 Oct 2023 17:29:54 +0200 Subject: [PATCH] Add param `profile` to `quarto_render()` --- R/inspect.R | 4 +--- R/render.R | 7 +++++++ man/quarto_render.Rd | 4 ++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/R/inspect.R b/R/inspect.R index 48b6af2..a5e333d 100644 --- a/R/inspect.R +++ b/R/inspect.R @@ -4,10 +4,8 @@ #' config and engines. Inspecting an input path return its formats, engine, #' and dependent resources. #' +#' @inheritParams quarto_render #' @param input The input file or project directory to inspect. -#' @param profile [Quarto project -#' profile](https://quarto.org/docs/projects/profiles.html) to use. If -#' `NULL`, the default profile is used. #' #' @return Named list. For input files, the list contains the elements #' `quarto`, `engines`, `formats`, `resources`, plus `project` if the file is diff --git a/R/render.R b/R/render.R index 84f9c54..00b841d 100644 --- a/R/render.R +++ b/R/render.R @@ -29,6 +29,9 @@ #' @param cache_refresh Force refresh of execution cache. #' @param debug Leave intermediate files in place after render. #' @param quiet Suppress warning and other messages. +#' @param profile [Quarto project +#' profile](https://quarto.org/docs/projects/profiles.html) to use. If +#' `NULL`, the default profile is used. #' @param pandoc_args Additional command line options to pass to pandoc. #' @param as_job Render as an RStudio background job. Default is "auto", #' which will render individual documents normally and projects as @@ -65,6 +68,7 @@ quarto_render <- function(input = NULL, cache_refresh = FALSE, debug = FALSE, quiet = FALSE, + profile = NULL, pandoc_args = NULL, as_job = getOption("quarto.render_as_job", "auto")) { @@ -142,6 +146,9 @@ quarto_render <- function(input = NULL, if (isTRUE(quiet)) { args <- c(args, "--quiet") } + if (!is.null(profile)) { + args <- c(args, "--profile", profile) + } if (!is.null(pandoc_args)) { args <- c(args, pandoc_args) } diff --git a/man/quarto_render.Rd b/man/quarto_render.Rd index a678391..0a5c14f 100644 --- a/man/quarto_render.Rd +++ b/man/quarto_render.Rd @@ -19,6 +19,7 @@ quarto_render( cache_refresh = FALSE, debug = FALSE, quiet = FALSE, + profile = NULL, pandoc_args = NULL, as_job = getOption("quarto.render_as_job", "auto") ) @@ -63,6 +64,9 @@ respectively for Rmd and Jupyter input files).} \item{quiet}{Suppress warning and other messages.} +\item{profile}{\href{https://quarto.org/docs/projects/profiles.html}{Quarto project profile} to use. If +\code{NULL}, the default profile is used.} + \item{pandoc_args}{Additional command line options to pass to pandoc.} \item{as_job}{Render as an RStudio background job. Default is "auto",