quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.77k stars 309 forks source link

Quarto does not preserve the render order mentioned in `_quarto.yaml` #10714

Open AliSajid opened 2 weeks ago

AliSajid commented 2 weeks ago

Bug description

Previously, under the 1.4 release, it was possible to control the order of execution of the qmd files by specifying them as an array in the metadata.

This is no longer possible with the versions going from 1.5 onwards. Controlling order of execution is important as evidenced by issues like #10463 , #10490, and this discussion.

Steps to reproduce

https://github.com/maxdrohde/quarto_render_order

Expected behavior

Specifying the order should render documents in order.

Actual behavior

The files are executed in arbitrary order.

Your environment

Quarto check output

Quarto 1.5.557
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.57
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /Users/aimami/Library/TinyTeX/bin/universal-darwin
      Version: 2022

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.12.5
      Path: /Users/aimami/.local/share/mise/installs/python/3.12/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.4.1
      Path: /opt/homebrew/Cellar/r/4.4.1/lib/R
      LibPaths:
        - /Users/aimami/Library/Caches/org.R-project.R/R/renv/library/drugfindR-edc455ab/macos/R-4.4/aarch64-apple-darwin23.4.0
        - /Users/aimami/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.4/aarch64-apple-darwin23.4.0/8b0c8122
      knitr: 1.47
      rmarkdown: 2.26

[✓] Checking Knitr engine render......OK
cscheid commented 2 weeks ago

Sorry, but we do need a full repro.

Change the order specified in https://github.com/quarto-dev/quarto-cli/pull/3 and run it again.

I don't understand what this pull request has to do with the report.

Can you please provide us with a git repository that we can clone from, where you see this behavior? Thank you.

maxdrohde commented 2 weeks ago

@cscheid I provided an example using my GitHub repository in my issue #10490. Thanks again for looking into this!

cscheid commented 2 weeks ago

Can you give us a small repo?

maxdrohde commented 2 weeks ago

I will try again. I tried making one before I submitted the issue with only a couple .qmd files but I couldn't get it to reproduce the ordering issue.

cscheid commented 2 weeks ago

Thanks!

maxdrohde commented 2 weeks ago

@cscheid I just figured it out, please see here: https://github.com/maxdrohde/quarto_render_order

When I run quarto render from the terminal, I see

❯ quarto render
[1/2] 2-file2.qmd
[2/2] 1-file1.qmd

processing file: 1-file1.qmd
1/3
2/3 [unnamed-chunk-1]
3/3
output file: 1-file1.knit.md

Output created: _output/1-file1.html

but the _quarto_yml is

project:
  title: "Ordering Test"
  output-dir: _output
  render:
    - 1-file1.qmd
    - 2-file2.qmd
author: "Maximilian Rohde"
date: today
format:
  html:
    toc: true
cscheid commented 2 weeks ago

Thank you, I can repro that!

cscheid commented 2 weeks ago

The issue is somehow related to engine determination. If you remove the code cell from 1-file1.qmd, the order changes.

AliSajid commented 2 weeks ago

Thank you @maxdrohde. @cscheid I meant to say repeat step 3, which github autolinked to Issue 3. Apologies.