Skip to content

Add failing test for quarto animint output copy#331

Open
ashishtiwari03 wants to merge 2 commits into
animint:masterfrom
ashishtiwari03:test-quarto-copy-325
Open

Add failing test for quarto animint output copy#331
ashishtiwari03 wants to merge 2 commits into
animint:masterfrom
ashishtiwari03:test-quarto-copy-325

Conversation

@ashishtiwari03
Copy link
Copy Markdown

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 checks
for 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 output
directory, 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.

Comment thread R/z_knitr.R
if (!file.exists(quarto.yml)) return(NULL)

yml.lines <- readLines(quarto.yml, warn = FALSE)
output.line <- grep("^[[:space:]]+output-dir:", yml.lines, value = TRUE)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems unusual. can you please post an issue on quarto to ask how we should do this?

Copy link
Copy Markdown
Author

@ashishtiwari03 ashishtiwari03 May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok thanks.
please try to do it without htmltools.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

@ashishtiwari03 ashishtiwari03 May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants