Description
However, QUARTO_DOCUMENT_PATH does not output the same (using the absolute path for project and using a relative path for non-project)
I have looked into the difference between project render and singlefile render
Both start with render()
which makes the input relative to Deno.cwd()
quarto-cli/src/command/render/cmd.ts
Lines 247 to 251 in a88e7cc
However, when in a project, there will be some context compute which will end up normalizing (by adding back the Deno.cwd()
like the following in renderProjects
quarto-cli/src/command/render/project.ts
Lines 287 to 294 in a88e7cc
quarto-cli/src/command/render/project.ts
Lines 150 to 168 in a88e7cc
So basically,
-
When this is a project,
renderFiles
is called with an absolute path
quarto-cli/src/command/render/project.ts
Lines 464 to 465 in a88e7cc
-
When not inside a project, so singleFile render,
renderFiles()
is called with a relative path
quarto-cli/src/command/render/render-shared.ts
Lines 103 to 111 in a88e7cc
This is the different we see in those environment variable from this PR, as it will be inherited by target.source
quarto-cli/src/execute/environment.ts
Line 16 in a88e7cc
It seems there is room for improvement to make things work the same.
Originally posted by @cderv in #12271 (comment)