-
Notifications
You must be signed in to change notification settings - Fork 289
Add use_r_universe_badge()
#1994
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
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jeroen Will you take a quick look at this? The only real question I have is about the most correct URL for the badge. I'll comment inline. |
} | ||
|
||
owner <- parse_repo_spec(repo_spec)[["owner"]] | ||
src <- glue("https://{owner}.r-universe.dev/{pkg}/badges/version") |
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 can't tell if the best form is what I currently have:
https://{owner}.r-universe.dev/{pkg}/badges/version
Or:
https://{owner}.r-universe.dev/badges/{pkg}
It feels like the prose and the example here sort of contradict each other?
https://docs.r-universe.dev/publish/set-up.html#badge-showing-the-number-of-the-deployed-version
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.
Also the markdown you get from the "copy markdown" button on a page like this:
https://r-lib.r-universe.dev/badges
looks like:
[](https://r-lib.r-universe.dev/usethis)
These examples are not great, as it stands. But I don't think showing the use `use_badge()` to create one's on R-universe badge is the most obvious usage to add here.
@@ -17,17 +17,23 @@ | |||
#' available on CRAN, powered by <https://www.r-pkg.org> | |||
#' * `use_lifecycle_badge()`: badge declares the developmental stage of a | |||
#' package according to <https://lifecycle.r-lib.org/articles/stages.html>. | |||
#' * `use_r_universe_badge()`: `r lifecycle::badge("experimental")` badge | |||
#' indicates what version of your package is available on [R-universe |
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.
Just to confirm: it's "R-universe" (lowercase "u"), yeah? As opposed to "R-Universe" (uppercase "U").
Closes #1883
Edit by @jennybc: I finished this off and sorted out various issues in the way that makes sense to me.
It has limitations, in the sense that it doesn't verify that the repo actually exists. It would also be great to add the r-universe installation options too.
I could add this to the badge with
ui_code()
It worked out of the box with usethis

implementation considerations
use_badge()
If you want, you can let me know what you think @jeroen. And you'd probably best to implement this function.
ideas
A
browse_r_universe()
similar tobrowse_github()
would probably be useful and easy to implement + the badge could build on top of this.man page preview