Open hgoers opened 2 years ago
My current workaround is this:
library(quarto)
library(purrr)
map(c("html", "docx"),
~ quarto_render(input = "template.qmd",
output_format = .x,
output_file = paste0("final_report.", .x)))
This produces final_report.html
and final_report.docx
.
Thinking about this, I think your workaround is a good one because you know what are the output format.
I tested with quarto CLI directly and it will indeed fails
quarto render index.qmd --output final_report
without any warning or workaround (to add an extension).
As this R package is only a wrapper of the CLI, I believe this should be fixed upstream directly, so I'll open an issue there to track this.
Thanks
I opened an issue upstream for this report
Current usage in this use case would be to set output-file
config
---
title: "Example title"
output-file: final_report
format:
HTML:
toc: true
docx:
toc: true
editor: source
---
From the R function, this could be done through metadata with the dev version of this package
quarto::quarto_render(input = "index.qmd",
output_format = "all",
metadata = list(output_file = "final_report")
)
Thanks so much for this!
Hello,
In
quarto_render()
, I am trying both to render multiple format types and to provide the output file with a different name to that of the Quarto document I am using. However,quarto_render()
does not adapt this supplied file name to each of the different file types. This results in a single document of type File, which gets overwritten each time the Quarto document renders each format type.Example:
template.qmd
:Code to render
template.qmd
:Output: A single
final_report
document of type File.Desired output: A
final_report.html
and afinal_report.docx
.Thanks!