Arguments
- x
- output_file
Destination path for the rendered output. Its directory and base name are used; the extension follows from the rendered format. If
NULL, the output is written to the working directory asdocument.<ext>.- output_format
Quarto output format (e.g.
"html","pdf"), passed toquarto::quarto_render().NULLuses the document / Quarto default.- ...
Further arguments passed to
quarto::quarto_render().- quiet
Suppress Quarto's rendering output.
Details
Writes an in-memory AST back to QMD with to_qmd() and renders it
with quarto::quarto_render(), the q2r analog of parsermd's
render(). The document is rendered inside a temporary directory and
the resulting artifacts (the rendered file plus any *_files/
resource directory) are copied to the destination, so it never
clobbers your working directory mid-render.
Because rendering happens in a temporary directory, relative resource
references in the document (local images, includes, {{< include >}}
shortcodes) will not resolve. This wrapper is intended for
self-contained documents.
Requires the quarto package (in Suggests) and a Quarto
installation.
Examples
if (FALSE) { # \dontrun{
doc = parse_qmd("# Title\n\nHello world.\n")
render_qmd(doc, "hello.html")
} # }