Render an FGCZ Quarto report

Description

Stages the shared styling assets next to input (via fgcz_copy_assets()) and then renders it with quarto::quarto_render(). The .qmd needs no styling front matter at all: the staged _metadata.yml is picked up by Quarto automatically, so the report stays fully portable.

Usage

fgcz_render(
  input,
  buttons = FALSE,
  colour = FALSE,
  number = FALSE,
  full_width = FALSE,
  fig_dpi = NULL,
  fig_retina = NULL,
  ...
)

Arguments

input Path to the .qmd to render.
buttons Which top-right toolbar buttons (fgcz-plot-finder.html) to add. Defaults to FALSE; TRUE enables all three buttons for backward compatibility. Alternatively, pass “search” for Find, “download” for Download, “source” for View source, or any combination, e.g. c(“search”, “download”). FALSE, NULL, and character(0) disable the toolbar.
colour Use the per-nesting-level tab colour palette (deep blue → indigo) instead of the default uniform folder tabs. Defaults to FALSE.
number Prefix every tab label with its hierarchical number (1, 1.1, 1.1.1 …). Defaults to FALSE.
full_width Fill the screen instead of the centred body cap. Drops the right margin track, so .column-margin / .column-screen are unsupported while on. Defaults to FALSE.
fig_dpi Override the shared _metadata.yml figure DPI (format.html.fig-dpi, default 300) for this render only. Useful for figure-heavy reports (many samples, many plots) where the default blows up the self-contained HTML size. NULL (the default) leaves the _metadata.yml value untouched.
fig_retina Override the shared _metadata.yml retina multiplier (knitr.opts_chunk.fig.retina, default 2) for this render only. The actual embedded-image resolution is fig_dpi * fig_retina, so dropping this alongside fig_dpi compounds the file-size reduction. NULL (the default) leaves the _metadata.yml value untouched.
Passed on to quarto::quarto_render() (e.g. execute_params, output_file, quarto_args). A metadata list passed here is honored; enabling buttons merges include-after-body into it, enabling colour or number merges the matching fgcz-colour / fgcz-number / fgcz-full-width keys, and fig_dpi / fig_retina merge into format.html.fig-dpi / knitr.opts_chunk.fig.retina – none of these clobber other keys you pass in metadata.

Value

The value of quarto::quarto_render(), invisibly.

Examples

library("fgczQuartoTemplate")

fgcz_render("CountQC.qmd", execute_params = list(reportTitle = "CountQC"))
fgcz_render("CountQC.qmd", buttons = TRUE) # with the full toolbar
fgcz_render("CountQC.qmd", buttons = "search") # Find only
fgcz_render("CountQC.qmd", buttons = c("search", "source")) # Find + View source
fgcz_render("CountQC.qmd", colour = TRUE, number = TRUE) # coloured, numbered
fgcz_render("CountQC.qmd", full_width = TRUE) # content fills the screen
fgcz_render("CountQC.qmd", fig_dpi = 150, fig_retina = 1) # smaller HTML