How can I determine which files will be rendered within a pre-render-script's execution during incremental directory-rendering? #10359
-
DescriptionHello, Assume I have a project with a pre-render script
Assume Further assume that a <- quarto::quarto_inspect()
root <- a$dir # get the project root.
...
pattern <- paste0("\\___.*\\.md")
files <- list.files(
path = root,
pattern = pattern,
full.names = TRUE,
recursive = TRUE
)
for (file in files) {
# some time-intensive operation
} Quarto allows incremental and project-wide renders, via During the R-script's execution, the relevant files to operate upon must be collected. Currently I retrieve the project's root as shown above, then parse the projects' contents and go from there. That is obviously fine for project-wide renders. For directory-restricted renders, I would love to use that path to reduce the number of files Unfortunately, Is this correct? Thank you. * Simplification. Only on files with a certain prefix in their name get processed. P.S.: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I don't understand your question/setup. "pre-render" script is a Quarto feature but it seems you are talking about something else, see https://quarto.org/docs/projects/scripts.html#pre-and-post-render. FWIW, even if I understand the appeal to do everything from R, here it seems a bit cumbersome and more complicated than providing an R script to Quarto and simply render the project. To be clear, the R package is only a wrapper around the real tool which is Quarto CLI. |
Beta Was this translation helpful? Give feedback.
I'm confused why don't you use the environment variable as documented in the pre/post render documentation if you are using this feature? https://quarto.org/docs/projects/scripts.html#pre-and-post-render
QUARTO_PROJECT_INPUT_FILES