Skip to contents

Creates and optionally renders a Quarto webpage using package templates.

Usage

.generate_webpage(
  proj_path = ".",
  output_dir = NA,
  template_folder = "quarto_base_templates",
  render = FALSE,
  open = render,
  ...
)

Arguments

output_dir

The directory where the Quarto files and rendered output should be saved.

render

Should the Quarto project/document be rendered? (Requires the quarto package and Quarto CLI). Defaults to TRUE.

open

Should the rendered output be opened? Defaults to render.

...

Additional arguments passed to glue::glue() for template filling.

data

Your input data or parameters needed for the report.

template_name

The name of the template directory within inst/quarto_templates (e.g., "basic_report", "full_website").

Value

Invisibly returns the path to the main output file or directory.

Examples

if (FALSE) { # \dontrun{
  # Create a temporary directory for output
  temp_dir <- tempdir()
  my_output_dir <- file.path(temp_dir, "my_report")

  generate_webpage(
    data = list(title = "My Dynamic Report", value = 42),
    output_dir = my_output_dir,
    template_name = "basic_report",
    report_date = Sys.Date() # Example of passing extra vars via ...
  )

  # Clean up
  unlink(my_output_dir, recursive = TRUE)
} # }