Add failing test for quarto animint output copy#331
Conversation
90c992e to
070c5aa
Compare
| if (!file.exists(quarto.yml)) return(NULL) | ||
|
|
||
| yml.lines <- readLines(quarto.yml, warn = FALSE) | ||
| output.line <- grep("^[[:space:]]+output-dir:", yml.lines, value = TRUE) |
There was a problem hiding this comment.
this seems unusual. can you please post an issue on quarto to ask how we should do this?
There was a problem hiding this comment.
Thanks, that makes sense. I opened an issue on Quarto to ask for the recommended way to get the project output
directory from inside knit_print():
https://github.com/orgs/quarto-dev/discussions/14545
There was a problem hiding this comment.
Quarto maintainers replied here:
https://github.com/orgs/quarto-dev/discussions/14545
They suggested that fig.path is probably not the right mechanism, and that dependencies associated with output
should probably go through knit_meta / knit_print() metadata, possibly via htmltools dependencies.
So I agree the current _quarto.yml parsing in this PR is probably not the right final approach. I can try revising
the fix in that direction.
There was a problem hiding this comment.
ok thanks.
please try to do it without htmltools.
There was a problem hiding this comment.
Based on the Quarto discussion, I will try revising this without htmltools and without parsing _quarto.yml.
I will look at using knitr::asis_output(..., meta = ...) / knit_meta directly, since knit_print.animint()
already returns metadata.
There was a problem hiding this comment.
cderv added another note in the Quarto discussion:
https://github.com/orgs/quarto-dev/discussions/14545
They suggested looking at how other packages ship HTML dependencies with knitr output. They mentioned that in rmarkdown contexts this is usually done through htmlwidgets or html dependencies.
Since you asked to try without htmltools, I will first check whether this can be done using knit_meta directly,
without adding htmltools-based dependencies.
Description
This PR adds a failing test for #325.
The test creates a small Quarto website project with one animint plot, renders it with
quarto::quarto_render(), and checksfor the generated animint files in
_site/myplot/.On current
master, the animint directory is created during knitting but is not copied into the Quarto website outputdirectory, so the rendered site is missing files such as
plot.json.No fix or NEWS entry is included yet. This is only the failing test commit, following the test-first workflow described in
the contributing guide.