diff --git a/DESCRIPTION b/DESCRIPTION index 918f8a3..ebb422e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,21 +1,23 @@ Package: kwb.pkgbuild Title: R package for standardised development at KWB -Version: 0.1.7 +Version: 0.1.8 Authors@R: c(person(given = "Michael", family = "Rustler", role = c("aut", "cre"), email = "michael.rustler@kompetenz-wasser.de", comment = c(ORCID = "0000-0003-0647-7726")), - person(given = "Kompetenzzentrum Wasser Berlin gGmbH (KWB)", - role = "cph"), person(given = "Hauke", family = "Sonnenberg", - role = "ctb", + role = "aut", email = "hauke.sonnenberg@kompetenz-wasser.de", - comment = c(comment = "0000-0001-9134-2871"))) + comment = c(ORCID = "0000-0001-9134-2871")), + person(given = "FAKIN", + role = "fnd"), + person(given = "Kompetenzzentrum Wasser Berlin gGmbH (KWB)", + role = "cph")) Description: Helper functions for automating R package development at KWB - to a predefined style. + to a predefined style. License: MIT + file LICENSE URL: https://github.com/KWB-R/kwb.pkgbuild BugReports: https://github.com/KWB-R/kwb.pkgbuild/issues @@ -27,21 +29,21 @@ Imports: fs, httr, kwb.utils, + magrittr, openssl, - processx, pkgdown, + processx, rematch2, sessioninfo, stringr, travis, usethis, withr, - yaml, - magrittr + yaml Suggests: covr, - kwb.orcid, knitr, + kwb.orcid, rmarkdown, testthat VignetteBuilder: diff --git a/NAMESPACE b/NAMESPACE index 1e54cae..a6b1a33 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -20,6 +20,7 @@ export(use_badge_ghactions) export(use_badge_ghactions_pkgdown) export(use_badge_ghactions_rcmdcheck) export(use_badge_lifecycle) +export(use_badge_runiverse) export(use_badge_travis) export(use_codecov) export(use_description) diff --git a/NEWS.md b/NEWS.md index 497dc6e..2575e89 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# [kwb.pkgbuild 0.1.8](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.8) 2021-07-13 + +* Add `use_badge_runiverse()` (for linking to [https://kwb-r.r-universe.dev](https://kwb-r.r-universe.dev)) +if package is available and use for `index.md` and `README.md` + # [kwb.pkgbuild 0.1.7](https://github.com/KWB-R/kwb.pkgbuild/releases/tag/v0.1.7) 2021-02-23 * Improve re-usability of Github Actions badges (for R package `kwb.pkgstatus`) diff --git a/R/grammars.R b/R/grammars.R index af8c068..922a6d9 100644 --- a/R/grammars.R +++ b/R/grammars.R @@ -53,5 +53,11 @@ grammars <- list( ), mirror = list( url = "https://cran..org/package=" + ), + runiverse = list( + url_runiverse = "r-universe.dev", + title = "R-Universe_Status_Badge", + src = "https://./badges/", + href = "https://./" ) ) diff --git a/R/use_badges.R b/R/use_badges.R index 73fb257..9255450 100644 --- a/R/use_badges.R +++ b/R/use_badges.R @@ -208,3 +208,23 @@ is_on_cran <- function(cran_link) ! errored && httr::status_code(x) == 200 } + + +# use_badge_runiverse ---------------------------------------------------------- + +#' Badge R-Universe +#' @param repo name of repository (default: NULL) +#' @param user user name or organisation under which repository defined in +#' parameter "repo" is hosted (default: KWB-R") +#' @return generates codecov badge link +#' @export +use_badge_runiverse <- function(repo = NULL, user = "KWB-R") +{ + kwb.utils::resolve( + "url", + grammars$general, + grammars$runiverse, + user = tolower(user), + pkgname = get_pkgname(repo) + ) +} diff --git a/R/use_index_md.R b/R/use_index_md.R index 50b3d9e..ab50a5a 100644 --- a/R/use_index_md.R +++ b/R/use_index_md.R @@ -23,6 +23,7 @@ use_index_md <- function( use_badge_codecov(pkg$name, user, domain ), use_badge_lifecycle(stage), use_badge_cran(pkg$name), + use_badge_runiverse(pkg$name), "", pkg$desc, "", diff --git a/R/use_readme_md.R b/R/use_readme_md.R index 55ff9fc..d3d4f15 100644 --- a/R/use_readme_md.R +++ b/R/use_readme_md.R @@ -8,7 +8,7 @@ #' to [https://www.tidyverse.org/lifecycle/](https://www.tidyverse.org/lifecycle/), #' valid arguments are: "experimental", "maturing", "stable", "retired", #' "archived", "dormant", "questioning"), (default: "experiment") -#' @return generates travis badge link +#' @return generates README.md #' @export #' @importFrom desc desc @@ -32,6 +32,7 @@ use_readme_md <- function( use_badge_codecov(pkg$name, user, domain ), use_badge_lifecycle(stage), use_badge_cran(pkg$name), + use_badge_runiverse(pkg$name), "", sprintf("# %s", pkg$name), "", diff --git a/README.md b/README.md index a5cbe3d..bd54a0f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![codecov](https://codecov.io/github/KWB-R/kwb.pkgbuild/branch/master/graphs/badge.svg)](https://codecov.io/github/KWB-R/kwb.pkgbuild) [![Project Status](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/kwb.pkgbuild)]() +[![R-Universe_Status_Badge](https://kwb-r.r-universe.dev/badges/kwb.pkgbuild)](https://kwb-r.r-universe.dev/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3387180.svg)](https://doi.org/10.5281/zenodo.3387180) # kwb.pkgbuild @@ -12,9 +13,22 @@ to a predefined style. ## Installation +For details on how to install KWB-R packages checkout our [installation tutorial](https://kwb-r.github.io/kwb.pkgbuild/articles/install.html). + ```r -#install.packages("remotes", repos = "https://cloud.r-project.org") -remotes::install_github("kwb-r/kwb.pkgbuild", INSTALL_opts = c('--no-multiarch')) +### Optionally: specify GitHub Personal Access Token (GITHUB_PAT) +### See here why this might be important for you: +### https://kwb-r.github.io/kwb.pkgbuild/articles/install.html#set-your-github_pat + +# Sys.setenv(GITHUB_PAT = "mysecret_access_token") + +# Install package "remotes" from CRAN +if (! require("remotes")) { + install.packages("remotes", repos = "https://cloud.r-project.org") +} + +# Install KWB package 'kwb.pkgbuild' from GitHub +remotes::install_github("KWB-R/kwb.pkgbuild") ``` ## Documentation diff --git a/_pkgdown.yml b/_pkgdown.yml index 9f3d5e6..35e136e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,14 +1,20 @@ authors: Michael Rustler: href: https://mrustl.de + Hauke Sonnenberg: + href: https://github.com/hsonne + FAKIN: + href: https://www.kompetenz-wasser.de/en/project/fakin/ + html: Kompetenzzentrum Wasser Berlin gGmbH (KWB): - href: http://www.kompetenz-wasser.de + href: https://www.kompetenz-wasser.de html: template: params: bootswatch: cerulean - docsearch: + docsearch: api_key: d114e26fe8901b7b424d949906e60102 index_name: kwb_pkgbuild development: diff --git a/index.md b/index.md index 10b450a..dff5435 100644 --- a/index.md +++ b/index.md @@ -1,18 +1,30 @@ -[![Appveyor build Status](https://ci.appveyor.com/api/projects/status/fpwyt36kp3wfd4x4/branch/master?svg=true)](https://ci.appveyor.com/project/KWB-R/kwb-pkgbuild/branch/master) -[![Travis build Status](https://travis-ci.com/KWB-R/kwb.pkgbuild.svg?branch=master)](https://travis-ci.com/KWB-R/kwb.pkgbuild) +[![R-CMD-check](https://github.com/KWB-R/kwb.pkgbuild/workflows/R-CMD-check/badge.svg)](https://github.com/KWB-R/kwb.pkgbuild/actions?query=workflow%3AR-CMD-check) +[![pkgdown](https://github.com/KWB-R/kwb.pkgbuild/workflows/pkgdown/badge.svg)](https://github.com/KWB-R/kwb.pkgbuild/actions?query=workflow%3Apkgdown) [![codecov](https://codecov.io/github/KWB-R/kwb.pkgbuild/branch/master/graphs/badge.svg)](https://codecov.io/github/KWB-R/kwb.pkgbuild) [![Project Status](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/kwb.pkgbuild)]() +[![R-Universe_Status_Badge](https://kwb-r.r-universe.dev/badges/kwb.pkgbuild)](https://kwb-r.r-universe.dev/) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3387180.svg)](https://doi.org/10.5281/zenodo.3387180) - - Helper functions for automating R package development at KWB to a predefined style. ## Installation +For details on how to install KWB-R packages checkout our [installation tutorial](https://kwb-r.github.io/kwb.pkgbuild/articles/install.html). + ```r -#install.packages("remotes", repos = "https://cloud.r-project.org") -remotes::install_github("kwb-r/kwb.pkgbuild", INSTALL_opts = c('--no-multiarch')) +### Optionally: specify GitHub Personal Access Token (GITHUB_PAT) +### See here why this might be important for you: +### https://kwb-r.github.io/kwb.pkgbuild/articles/install.html#set-your-github_pat + +# Sys.setenv(GITHUB_PAT = "mysecret_access_token") + +# Install package "remotes" from CRAN +if (! require("remotes")) { + install.packages("remotes", repos = "https://cloud.r-project.org") +} + +# Install KWB package 'kwb.pkgbuild' from GitHub +remotes::install_github("KWB-R/kwb.pkgbuild") ``` diff --git a/man/use_badge_runiverse.Rd b/man/use_badge_runiverse.Rd new file mode 100644 index 0000000..7c2b382 --- /dev/null +++ b/man/use_badge_runiverse.Rd @@ -0,0 +1,20 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/use_badges.R +\name{use_badge_runiverse} +\alias{use_badge_runiverse} +\title{Badge R-Universe} +\usage{ +use_badge_runiverse(repo = NULL, user = "KWB-R") +} +\arguments{ +\item{repo}{name of repository (default: NULL)} + +\item{user}{user name or organisation under which repository defined in +parameter "repo" is hosted (default: KWB-R")} +} +\value{ +generates codecov badge link +} +\description{ +Badge R-Universe +} diff --git a/man/use_readme_md.Rd b/man/use_readme_md.Rd index e4cfece..ee56a7a 100644 --- a/man/use_readme_md.Rd +++ b/man/use_readme_md.Rd @@ -18,7 +18,7 @@ valid arguments are: "experimental", "maturing", "stable", "retired", "archived", "dormant", "questioning"), (default: "experiment")} } \value{ -generates travis badge link +generates README.md } \description{ Use README