Skip to contents

HTML, PDF and DOCX rendering use the Quarto templates shipped in inst/quarto/ and require the Quarto CLI plus the quarto R package. XLSX output is delegated to write_report_xlsx and requires openxlsx2. Rendering happens in a temporary directory; the installed package is never written to.

Usage

render_minesdg_report(report, output_file,
  format = c("html", "pdf", "docx", "xlsx"), template = NULL,
  quiet = TRUE)

Arguments

report

A minesdg_report object.

output_file

Path of the output document. Its directory must exist.

format

One of "html", "pdf", "docx", "xlsx".

template

Optional path to a user-supplied .qmd template used instead of the packaged one.

quiet

Suppress Quarto output (default TRUE).

Value

The path to the rendered file, invisibly.

Examples

# \donttest{
rep <- generate_gri_report(demo_mine_sites, site_id = "CU-ATAC",
                           years = 2023:2024)
out <- render_minesdg_report(rep, file.path(tempdir(), "gri.html"))
# }