The robust way to do this is to use knitr::opts_chunk$set() to save code-generated images in the man/ directory.
Users who want to display static files in their README should also save them in the man/ directory. AFAICT, this has been the "traditional" and "correct" way to achive this for a long time on CRAN.
The downside of this approach is that it requires a bit of user-intervention (it's not hard and we can document it).
The upside is that we don't need to write dangerous/broken code in altdoc, and that images are "guaranteed" to work on CRAN, Github, and on the website.
This PR adds a README.qmd in the altdoc repo, with a new section which displays code-generated and static images. That way, the altdoc repo acts as a self-contained example of best practices.
This PR also removes the .img_readme_move() and related functions.
It is unsafe to use regexes to modify the links in the REAMDE, as demonstrated by https://github.com/etiennebacher/altdoc/issues/178
The robust way to do this is to use
knitr::opts_chunk$set()
to save code-generated images in theman/
directory.Users who want to display static files in their README should also save them in the
man/
directory. AFAICT, this has been the "traditional" and "correct" way to achive this for a long time on CRAN.The downside of this approach is that it requires a bit of user-intervention (it's not hard and we can document it).
The upside is that we don't need to write dangerous/broken code in
altdoc
, and that images are "guaranteed" to work on CRAN, Github, and on the website.This PR adds a
README.qmd
in thealtdoc
repo, with a new section which displays code-generated and static images. That way, thealtdoc
repo acts as a self-contained example of best practices.This PR also removes the
.img_readme_move()
and related functions.