quarto-dev / quarto-dev/quarto-cli
index_files not copied to project.output-dir with certain markdown formats
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
Hi folks.
I am rendering a document with project.output-dir specified in _quarto.yml
When some index.qmd contains a code block to generate some index_files, the index_files directory is not being copied to the output-dir when certain output formats (like hugo-md) are used.
The index_files are correctly copied with other output formats (like pdf or commonmark), so this is somehow format-specific.
Steps to reproduce
note: this example was edited to reflect advice below about project.type = hugo
The code below replicates the issue for me on the following quarto version:
quarto --version
shows 1.6.40.
First let's make a .qmd that we will use.
I am using a small mermaid diagram as a code chunk that should generate dependencies in index_files.
We put in page sub-directory.
mkdir ./page
echo -e "---\ntitle: my title\n---\n\n\`\`\`{mermaid}\nflowchart LR\nA[start] --> B[end]\n\`\`\`" > page/index.qmd
I will then use _quarto.yml files to vary the render behavior.
We save the output to output sub-directory.
md output behaves, as I understand, correctly.
echo "project:\n output-dir: output\nformat: md" > _quarto.yml
quarto render page/index.qmd
ls output/page
The ls output shows:
index.html index_files
Here is an example with gfm output.
# gfm
rm -rf ./output
echo "project:\n output-dir: output\nformat: gfm" > _quarto.yml
quarto render page/index.qmd
ls output/page
and now the ls command only shows index.md.
And here is an example with hugo-md which also sets project.type to hugo.
rm -rf ./output
echo "project:\n output-dir: output\n type: hugo\nformat: hugo-md" > _quarto.yml
quarto render page/index.qmd
ls output/page
again ls only shows index.md
Expected behavior
As I understand, we should always expect index_files to appear in the output dir.
Actual behavior
On my side, the following outputs place index_files in the output-dir:
- typst
- html
- md
- markdown
- hugo-markdown
- commonmark
- hugo-commonmark
And these formats do not plaace index_files in the output dir:
- hugo-md
- gfm
- hugo-gfm
and that's all I have tested.
Your environment
- OS: MacOS Sonoma 14.5
- quarto 1.6.40 installed as homebrew cask
Quarto check output
quarto check
Quarto 1.6.40
[✓] Checking environment information...
Quarto cache location: /Users/michaeldecrescenzo/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.40
Path: /Applications/quarto/bin
[✓] Checking tools....................OK
TinyTeX: v2024.12
Chromium: (not installed)
[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/michaeldecrescenzo/Library/TinyTeX/bin/universal-darwin
Version: 2024
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.13.0
Path: /opt/homebrew/opt/python@3.13/bin/python3.13
Jupyter: (None)
Jupyter is not available in this Python installation.
Install with python3 -m pip install jupyter
[✓] Checking R installation...........OK
Version: 4.3.3
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
knitr: (None)
rmarkdown: (None)
The knitr package is not available in this R installation.
Install with install.packages("knitr")
The rmarkdown package is not available in this R installation.
Install with install.packages("rmarkdown")
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with page/index.qmd and the three _quarto.yml configurations, especially gfm and hugo-md, using quarto render. Compare the generated output/page contents across formats and trace the format-specific output handling. Done means index_files is copied into output/page for the affected formats without regressing the formats that already work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100