-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
746 additions
and
439 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
#' badge_codecov | ||
#' | ||
#' @param repo_full_names vector with combination of username/repo (e.g. | ||
#' c("KWB-R/kwb.utils", "KWB-R/kwb.db")) | ||
#' @return codecov badges for provided repo_full_names | ||
#' @export | ||
|
||
badge_codecov <- function(repo_full_names) { | ||
paste0("[![codecov](https://codecov.io/github/", | ||
repo_full_names, | ||
"/branch/master/graphs/badge.svg)](https://codecov.io/github/", | ||
repo_full_names, | ||
")") | ||
|
||
badge_codecov <- function(repo_full_names) | ||
{ | ||
to_full_url <- function(path_pattern) { | ||
compose_url( | ||
protocol = "https", | ||
domain_name = "codecov.io", | ||
path = sprintf(path_pattern, repo_full_names) | ||
) | ||
} | ||
|
||
image_link( | ||
image_name = "codecov", | ||
image_url = to_full_url("github/%s/branch/master/graphs/badge.svg"), | ||
link_url = to_full_url("github/%s") | ||
) | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
#' badge_cran | ||
#' | ||
#' @param repo_names vector of repository names (e.g. c("kwb.utils", "kwb.db")) | ||
#' @return crank badges for provided repo_names | ||
#' @export | ||
badge_cran <- function(repo_names) { | ||
paste0("[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/", | ||
repo_names, | ||
")](http://www.r-pkg.org/pkg/", | ||
repo_names, | ||
")") | ||
badge_cran <- function(repo_names) | ||
{ | ||
to_full_url <- function(path) { | ||
compose_url( | ||
protocol = "http", | ||
subdomain = "www", | ||
domain_name = "r-pkg.org", | ||
path = paste0(path, "/", repo_names) | ||
) | ||
} | ||
|
||
image_link( | ||
image_name = "CRAN_Status_Badge", | ||
image_url = to_full_url("badges/version"), | ||
link_url = to_full_url("pkg") | ||
) | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
#' badge_dependencies | ||
#' | ||
#' @param repo_names vector of repository names (e.g. c("kwb.utils", "kwb.db")) | ||
#' @return dependency badges for provided repo_names | ||
#' @export | ||
badge_dependencies <- function(repo_names) { | ||
paste0("[![Dependencies_badge](https://kwb-githubdeps.netlify.app/badge/", | ||
repo_names, | ||
")](https://kwb-githubdeps.netlify.app)") | ||
badge_dependencies <- function(repo_names) | ||
{ | ||
to_full_url <- function(path = "") { | ||
compose_url( | ||
protocol = "https", | ||
subdomain = "kwb-githubdeps", | ||
domain_name = "netlify.app", | ||
path = path | ||
) | ||
} | ||
|
||
image_link( | ||
image_name = "Dependencies_badge", | ||
image_url = to_full_url(paste0("badge/", repo_names)), | ||
link_url = to_full_url() | ||
) | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
#' badge_gitlab | ||
#' | ||
#' @param url url to repository on Gitlab | ||
#' @param logo_path path to Gitlab logo (default: | ||
#' "https://gitlab.com/gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png") | ||
#' @param size size of logo in pixels (default: 24) | ||
#' @return Gitlab logo in html with path to repository in Gitlab | ||
#' @export | ||
|
||
badge_gitlab <- function(url, | ||
logo_path = paste0("https://gitlab.com/gitlab-com/gitlab-artwork/raw/", | ||
"master/logo/logo-square.png"), | ||
size = 24) { | ||
badge_gitlab <- function( | ||
url, | ||
logo_path = compose_url( | ||
protocol = "https", | ||
domain_name = "gitlab.com", | ||
path = "gitlab-com/gitlab-artwork/raw/master/logo/logo-square.png" | ||
), | ||
size = 24 | ||
) | ||
{ | ||
img_attr <- sprintf(" title='Gitlab' width='%d' height = '%d'", size, size) | ||
|
||
sprintf("<a href='%s'><img src='%s' title='Gitlab' width='%d' height = '%d'/></a>", | ||
url, | ||
logo_path, | ||
size, | ||
size) | ||
} | ||
logo_path %>% | ||
html_img(img_attr) %>% | ||
html_a(href = url) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.