pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

More robust CRAN/Bioconductor package sidebar linking

Open AEBilgrau opened this issue 2 years ago • 3 comments

Perhaps a "fringe issue". In cran_link URLs are hardcoded. If these cannot be resolved, for whatever reason, the code fail. You can reproduce the error by pointing to non-resolvable host.

We currently hit this as our company's corporate filter currently blocks "cloud.r-project.org". While we hopefully wait for a whitelisting, my initial thought was to use "cran.r-project.org" (which is not blocked).

Our current workarounds with disabling internet or the sidebar has undesired additional effects.

Do you consider this an issue at all?

If so, would you be willing to consider one or more of the following fixes

  1. Allowing users (e.g. via option pkgdown.cran_mirror and similar) to specific alternative mirrors? So that the canonical https://cran.r-project.org/package=foo could be used.
  2. Make more robust checks on R errors as well and not only http errors.
  3. Option to disable "cran_linking" in the sidebar entirely.

Or others solutions?

AEBilgrau avatar Apr 13 '23 18:04 AEBilgrau

This is also a problem for me right now, since r-project.org is down at the moment. I'd like to use the https://cran.rstudio.com/ mirror, but there's no way to do so--the only workaround is to disable cran linking entirely (undesirable). I think option 1 you suggest, allowing the cran mirror to be configured, would be a reasonable solution.

dvg-p4 avatar Oct 27 '23 17:10 dvg-p4

Also @AEBilgrau you can actually disable cran linking entirely with options(pkgdown.internet = FALSE)

dvg-p4 avatar Oct 27 '23 17:10 dvg-p4

@dvg-p4 It's quite some time since I looked at it, but I (think I) remember that toggling that option disabled some other things as well that depends on internet connectivity.

AEBilgrau avatar Oct 29 '23 19:10 AEBilgrau

Thanks for filing this issue! Unfortunately, I think given the other demands for pkgdown features and the relatively limited impact of this one, it's unlikely we will ever implement it. Even though I'm closing this issue, I really appreciate the feedback, and hope you'll continue to contribute in the future 😄

hadley avatar Apr 12 '24 14:04 hadley

Hi @hadley @AEBilgrau , we are using pkgdown::build_site command to publish documentation of some internal packages which are not on CRAN and are facing the same issue. ChatGPT suggested to have following structure in _pkgdown.yml file so as to not have any links in the documentation but that didn't help.

home:
  sidebar:
    structure: [license, authors]

How do we fix it, any ideas?

shahr43 avatar Jul 28 '25 10:07 shahr43