Replies: 1 comment 9 replies
-
Why did you expect this? execute options are for computation only, it has nothing to do with all files/resources are located by their path. Files/resources are relatives to the document using them.
This would require all Quarto files to have unique names. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We use includes to re-use content across documents in a Quarto website project.
In this project, we set the option
execute-dir: project
to keep the working directory for computations pinned to the root directory of the project. That way, for example, all documents can refer to./data/fancy_data
, regardless of which subfolder they are placed in. For us this is important because we organize the content of the project in a bunch of subfolders that can go nested to different depth. Without theexecute-dir: project
the project would simply be much harder to mantain and keep track of the paths we should use in each document.We expected
{{< include >}}
to follow the same project'sexecute-dir
option, but it doesn't seem so. Instead, it always resolves to the same folder of the file you are including content in. So if you are in a subfolder and whant to include some content in the root of the project, you cannot do this{{< include _codebit.qmd>}}
, but you have to do something like this{{< include ../../../_codebit.qmd>}}
. And the../../...
part would depend on where the document lives and if you decide to reorganize the structure of the documents, you would need to update that as well. So, it is a bit of a mess.We couldn't find a way around this or any other option similar to
execute-dir
, but for the whole working directory of the project and not only for computations.Wouldn't it be better to have the includes directive to follow the
execute-dir
option?, is there currently any way to do it?Beta Was this translation helpful? Give feedback.
All reactions