Skip to content

Files generated with pre-render script are not discovered in the render stage #14028

@CodrinSocol

Description

@CodrinSocol

I have:

  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide

Bug description

I have a pre-render script that finds all .md files inside the project and saves them as .qmd. The actual render that quarto runs on quarto preview does not pick up that the .qmd files were created in the pre-render script. This only happens for the first time when running quarto preview - if the files already exist before the pre-render is executed, then they are included in the file render list. This thread describes this issue as being fixed in v1.5, but I still experience it in v1.8:

The Quarto project is saved and run in WSL.

Steps to reproduce

Small Reproducible example:

root
| file.md
| pre-render.py
| _quarto.yml
| index.qmd
| styles.css

pre-render.py file:

#!/usr/bin/env python3
from pathlib import Path

def main():
    root = Path(".")
    md_files = root.rglob("*.md")

    for md_file in md_files:
        qmd_file = md_file.with_suffix(".qmd")
        print(f"Converting {md_file} -> {qmd_file}")

        content = md_file.read_text(encoding="utf-8")
        qmd_file.write_text(content, encoding="utf-8")

if __name__ == "__main__":
    main()

_quarto.yml file:

project:
  type: website
  pre-render: pre-render.py
  render:
    - "**/*.qmd"

website:
  title: "test"
  navbar:
    left:
      - href: index.qmd
        text: Home
      - about.qmd

format:
  html:
    theme:
      - cosmo
      - brand
    css: styles.css
    toc: true
  1. Create new Quarto Website Project
  2. From the boilerplate code generated by quarto create, replace the _quarto.yml file contents with the code above
  3. Create a file.md file and add any markdown content within
  4. Create a pre-render.py Python file in the root of the repository and paste contents from above
  5. Run quarto preview. Terminal output:
Preparing to preview
pre-render.py
Converting file.md -> file.qmd

[1/2] about.qmd
[2/2] index.qmd

Watching files for changes
Browse at http://localhost:6976/
  1. Notice that the file.qmd was generated, but Quarto did not recognize it in the terminal outputs.
  2. Rerunning quarto preview will include the newly file.qmd in the render list. Terminal output:
Preparing to preview
pre-render.py
Converting file.md -> file.qmd

[1/1] file.qmd

Watching files for changes
Browse at http://localhost:6791/file.html

Actual behavior

Quarto does not include files generated in the pre-render script in the list of files that need to be rendered for the preview.

Expected behavior

Quarto should regenerate the list of files to render after the execution of the pre-render script to include newly generated files in the render previews.

Your environment

  • IDE: WebStorm 2025.3.1
  • Windows 11 (WSL with Ubuntu 24.04)

Quarto check output

Quarto 1.8.27
[✓] Checking environment information...
      Quarto cache location: /home/codrin_socol/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.3.1: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.8.27
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: v2026.02
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: TinyTex
      Path: /home/codrin_socol/.TinyTeX/bin/x86_64-linux
      Version: 2025

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /usr/bin/google-chrome
      Source: PATH

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.12
      Path: /home/codrin_socol/.pyenv/versions/3.12.12/bin/python3
      Jupyter: (None)

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

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions