In animint2 we are trying to support interactive plots in Quarto websites/books.
Context: animint/animint2#325
PR: animint/animint2#331
animint2::knit_print.animint() writes a directory of web assets for each plot, for example myplot/plot.json,
myplot/animint.js, etc. The HTML returned by knit_print() refers to myplot/plot.json.
This works in single-file R Markdown, but in Quarto website/book projects the final rendered output goes into a
project output directory such as _site/ or _book/. We need to copy the generated asset directory into the final
output directory.
Question: from inside an R package knit_print() method during quarto::quarto_render(), what is the recommended way
to determine the final output directory for the current document/project?
Is there an official environment variable, knitr option, or Quarto API that gives the project output directory and
current document output path? We want to avoid manually parsing _quarto.yml.
In animint2 we are trying to support interactive plots in Quarto websites/books.
Context: animint/animint2#325
PR: animint/animint2#331
animint2::knit_print.animint()writes a directory of web assets for each plot, for examplemyplot/plot.json,myplot/animint.js, etc. The HTML returned byknit_print()refers tomyplot/plot.json.This works in single-file R Markdown, but in Quarto website/book projects the final rendered output goes into a
project output directory such as
_site/or_book/. We need to copy the generated asset directory into the finaloutput directory.
Question: from inside an R package
knit_print()method duringquarto::quarto_render(), what is the recommended wayto determine the final output directory for the current document/project?
Is there an official environment variable, knitr option, or Quarto API that gives the project output directory and
current document output path? We want to avoid manually parsing
_quarto.yml.