-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File in subdirectory not found #11360
Comments
Could you try using the 1.6 pre-release? |
It happens also with 1.6.33 |
Thanks.
Note that the main issue is that you use relative (to calling document) paths since you are not in a Quarto project Add I'm not sure this is really a bug, look at the path from the error message. |
Ah, thanks for noticing this. However,
Quarto also fails when prepending
Quarto creates the correct absolute path but adds
|
Could you make a Git repository to share the structure of your project/example? |
Thanks for your feedback! The command also fails with a quarto project file. Is it okay to share R code with you to create the file structure? fs::dir_create("subdir")
fs::dir_create(file.path("subdir", "b"))
lines <- c(
"---",
"title: main",
"format:",
" html:",
" default",
"---",
"",
"{{< include \"./subdir/text1.qmd\" >}}"
)
writeLines(lines, "main.qmd")
lines <- c(
"# First File",
"",
"Some text here.",
"",
"{{< include \"./subdir/b/text2.qmd\" >}}"
)
writeLines(lines, file.path("subdir", "text1.qmd"))
lines <- c(
"# Second File",
"",
"Some text here.",
""
)
writeLines(lines, file.path("subdir", "b", "text2.qmd"))
lines <- c(
"project:",
" output-dir: myoutdir",
" render:",
" - main.qmd"
)
writeLines(lines, "_quarto.yml")
|
If you still use document relative paths, adding Quoting myself:
|
You are right, now it works. But is it intended behavior that relative paths do not work? If it is intended behavior, I think quarto should error when relative paths are given. |
We definitely want to fix this but it might be too late to sneak this to the first 1.6 version. We'll do it in 1.7 and backport the fix. |
Bug description
I recently updated to quarto version 1.5.57 from 1.5.35. After updating, quarto inspect is no longer able to find a document file in a subdirectory. Ironically, quarto render works fine. I could bisect that this problem appeard between v1.5.51 and v1.5.57. I assume this commit is the culprit.
Please see this MR as a reference where the issue appeared first.
Steps to reproduce
Create these files:
Main file:
Text 2 (in
./subdir/
):# Second File Some text here. {{< include "subdir/b/text3.qmd" >}}
Text 3 (in
./subdir/b/
):# Third File Some text here.
Now, run
quarto inspect
.Expected behavior
quarto inspect
outputs the desired information.Actual behavior
quarto inspect
fails with the following message:quarto render
runs fine. Even after removing thesubdir
in the include oftext3.qmd
, the command fails.Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: