Skip to contents

Renders a file ("chapter") or subdirectory ("part") of a Quarto book project to the specified profile. Convenience wrapper around quarto::quarto_render(), which by default renders the file that is currently active in RStudio.

Note that this function is not very useful for output_format = "pdf" because Quarto can only build the whole PDF at once, not individual pages only, hence no partial rendering is possible.

Usage

render_partly(
  path = rstudioapi::getActiveDocumentContext()$path,
  profile = default_profiles(),
  output_format = "html",
  execute = TRUE,
  execute_daemon_restart = FALSE,
  execute_debug = FALSE,
  use_freezer = FALSE,
  cache_refresh = FALSE,
  debug = FALSE,
  quiet = FALSE,
  pandoc_args = NULL,
  as_job = getOption("quarto.render_as_job", default = interactive() &&
    rstudioapi::isAvailable())
)

Arguments

path

Path to a file ("chapter") or subdirectory ("part") of a Quarto book project.

profile

Quarto project profile(s) to use. Either a character vector of profile names or NULL to use the default profile.

output_format

Target output format (defaults to "html"). The option "all" will render all formats defined within the file or project.

execute

Whether to execute embedded code chunks.

execute_daemon_restart

Restart keepalive Jupyter kernel before render. Note this option is only applicable for rendering Jupyter notebooks or Jupyter markdown.

execute_debug

Show debug output for Jupyter kernel.

use_freezer

Force use of frozen computations for an incremental file render.

cache_refresh

Force refresh of execution cache.

debug

Leave intermediate files in place after render.

quiet

Suppress warning and other messages.

pandoc_args

Additional command line arguments to pass on to Pandoc.

as_job

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.

Value

path, invisibly.

Details

This function is registered as an RStudio add-in, allowing RStudio users to assign a custom shortcut to it and to invoke it from the command palette. Note that the default path = rstudioapi::getActiveDocumentContext()$path does only work when called via a keyboard shortcut, not when called from the command palette. This is because the command palette steals focus and in consequence the document underneath is not considered currently active anymore as long as the command palette is opened.

Examples

if (FALSE) { # \dontrun{
# only works from inside a Quarto project
quappo::render_partly()} # }