Output directory in quarto-cli not respected?

Hi all,
I am terying quarto as a replacement for my Rmd-based rmarkdown::render workflow to render reports into specific folders. The usual project structure has the Rmd files in a scripts folder and then I render them to specific results folders :

project_base:

  • scripts/
    • hello.Rmd
  • results/
    • reports/
      • hello.html

I do this with:

rmarkdown::render(
  "scripts/hello.Rmd",
  output_dir = "results/reports"
)

Trying to recreate this in quarto-cli with a simple example, I thought thought the way to go was the option --output-dir:

quarto render scripts/hello.qmd --output-dir report/

However this places all outputs in the same directory as the qmd file (scripts/) and not in the output-dir:

ls scripts/
hello_files  hello.html  hello.qmd

Is this the expected behaviour? Is there a way to replicate the rmarkdown::render(output_dir = "dir") behaviour?

Cheers-

I've had the same problem specifying the output-dir: option in the _quarto.yml file. Keeping code in separate folder is important so that I can ensure only code gets uploaded to github, whereas outputs get ignored. It's inconvenient to add a *_files/ to my .gitignore as opposed to my output/ covering everything in the output folder.

@Rory_OG I totally get it. That is also a reason why I keep most of my reports away form the scripts.

I had a tip on twitter that --output-dir would work inside a "Quarto project". So I created the project with quarto create and then rendered my script with quarto render scripts/hello.qmd --output-dir results. It sort of works, but the output is sent to "results/scripts/".

So my conclusion is that for now I will stick to rmarkdown::render and tell my pythonista colleagues to use quarto for simpler use cases and testing, but not for production yet.

I spent a lot of tome yesterday and today researching different approaches. I ultimately opted to keep the reports in the root directory and use a combination of:

output-dir: output  
post-render: xcopy *_files output 

to get the html and the supporting files moved into the output folder. For some reason, output-dir hasn’t been moving the supporting files so I found the shell command as a work around.