-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature: Link to bioconductor vignettes #145
Conversation
Avoids error with r-devel today: If Bioconductor is not supported, there is not any bioconductor package available.
Is there possibly an easier way to detect if a package is from BioConductor by inspecting |
Oh yes, I did not realize that to get the path to the vignette we already required the package to be installed. This simplifies a lot the code. Thanks! I suggest to squash the commits when merging into main. |
R/link.R
Outdated
# Returns NA if package is not installed. | ||
# Returns TRUE if `package` is from Bioconductor, FALSE otherwise | ||
is_bioc_pkg <- function(package) { | ||
desc <- suppressWarnings({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the warning that you are suppressing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the package is missing, packageDescription
returns NA
, but it also triggers a warning:
> packageDescription("potato")
[1] NA
Warning message:
In packageDescription("potato") : no package 'potato' was found
Would you prefer that I check if the package is installed via rownames(installed.packages())
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since downlit already depends on rlang, you can use rlang::is_installed()
. I think it's better to switch based on that, rather than suppressing the warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks for all your time and the feedback!
R/link.R
Outdated
# Returns TRUE if `package` is from Bioconductor, FALSE otherwise | ||
is_bioc_pkg <- function(package) { | ||
if (!rlang::is_installed(package)) { | ||
return(NA) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be simpler if you made this FALSE
; then you wouldn't need the isTRUE()
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 👍
Thanks! |
This merge request provides support to parse
vignette(...)
calls that call vignettes from Bioconductor packages.With the latest CRAN release version, a link is formed that returns a 404 error:
With this pull request, we get the correct link:
I went through a rabbit hole the last afternoon starting from pkgdown until I got here, I hope I can help get this fixed.