Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set knitr.graphics.rel_path = FALSE to opt-out inadequate path processing #2508

Closed
wants to merge 8 commits into from

Conversation

cderv
Copy link
Contributor

@cderv cderv commented Apr 30, 2024

This complements #2502 by reverting the new path handling in pkgdown to set the option instead.

It solves fixes #2334 and fixes #2341 too.

#2341 about gganimate also requires rmarkdown 2.25 or future patch version with regression from 2.26 fixed (rstudio/rmarkdown#2554).

I did not change the tests from #2502 to verify it passes correctly. On my local windows, it works ok.

hadley added 5 commits April 25, 2024 17:03
For some unknown reason, `knitr_print()` methods sometimes produces paths are relative to the input directory, rather than to the output directory. This PR re-parents those to paths to be relative to the output directory making them work again.

Fixes r-lib#2334. Fixes r-lib#2341.
And resolve issue with using tempdir
@cderv cderv changed the base branch from knitr-rel-path to main April 30, 2024 13:31
cderv added 2 commits April 30, 2024 15:36
…ve path processing.

This processing is by default, and paths are made relative to input directory and not output.

It should be fixed in later knitr version yihui/knitr#2171
@cderv cderv force-pushed the knitr-rel-path-2 branch from 62ef742 to 5cde117 Compare April 30, 2024 13:36
@cderv
Copy link
Contributor Author

cderv commented Apr 30, 2024

I need to use main as base branch to have the test running. I force-pushed some edits to trigger CI

@cderv
Copy link
Contributor Author

cderv commented Apr 30, 2024

So I'll still look into this as knitr keeps creating some undesired path here.... 👀

@cderv
Copy link
Contributor Author

cderv commented Apr 30, 2024

So the problem with the path fixing here was in fact due to the regression in R Markdown 2.26.

Fixing it solves the issue.

So solution is indeed,

  • Using dev rmarkdown
  • Setting knitr.graphics.rel_path = FALSE

#2502 will handle it, setting the knitr option differently, so I'll close this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants