Skip to content
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

Add working-directory input to Quarto publish action #114

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gadenbuie
Copy link

@gadenbuie gadenbuie commented Aug 28, 2024

There are cases where quarto render docs/index.qmd is not the same as cd docs && quarto render index.qmd.

This PR adds a working-directory input to account for this difference. When used, input.path is relative to input.working-directory.

@cderv
Copy link
Collaborator

cderv commented Aug 28, 2024

Did you found this problem on a specific example ?

I would think this matters when used with a repo which is not a Quarto project ?

@gadenbuie
Copy link
Author

I needed it for https://github.com/posit-conf-2024/level-up-shiny/tree/main where the Quarto website is hosted in website/, in particular because of the issue with the revealjs-url path:

That was the motivation, but it's also possible that there are other things that happen (pre- or post-processing steps?) that might need quarto render to be called in the right working directory.

If I were in your shoes, I'd worry about confusion between input.path and input.working-directory. At the same time, having quarto render always work exactly the same regardless of the directory from which its called could be difficult. I think you could add input.working-directory but downplay its use in the documentation, or even just leave it undocumented other than in the action file itself.

@cderv
Copy link
Collaborator

cderv commented Aug 28, 2024

At the same time, having quarto render always work exactly the same regardless of the directory from which its called could be difficult.

quarto render inside a project (i.e with a _quarto.yml up the tree should always behave the same, in the sense that project root will be used. but maybe this is not that true and we have some edge case (like revealjs-url) where the Deno.cwd() (which is what change between the two cases) matters.

I'll think about it in context of this action. Especially to document it correctly. I consider this working-directory to be advanced usage. Usually with Quarto you should call from project root, and use path to file when you need incremental rendering.

If feels to me we have some holes somewhere in path considerations 🤔

@cscheid
Copy link
Contributor

cscheid commented Aug 28, 2024

If feels to me we have some holes somewhere in path considerations 🤔

Yes, this feels like a bug to me as well.

@gadenbuie
Copy link
Author

Usually with Quarto you should call from project root, and use path to file when you need incremental rendering.

Ah this is exactly what I'm getting at here. When the quarto site or project root isn't the repo root, then using input.working-directory would let you cd my-project && quarto render rather than quarto render my-project (the current allowed invocation using only input.path).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants