Title: | Create Badges for 'Travis', 'Repostatus' 'Codecov.io' Etc in Github Readme |
---|---|
Description: | Tired of copy and pasting almost identical markdown for badges in every new R-package that you create, on Github or other code-sharing sites? This package allows you to easily paste badges. If you want to, it will also search your DESCRIPTION file and extract the package name, license, R-version, and current projectversion and transform that into badges. It will also search for a ".travis.yml" file and create a "Travis"" badge, if you use "Codecov.io" to check your code coverage after a "Travis" build this package will also build a "Codecov.io"-badge. All the badges can be placed individually or can be placed below the top "YAML"" content of your "RMarkdown file" (Readme.Rmd) or "README.md" file. Currently creates badges for Projectstatus ("Repostatus.org"), license Travis Build Status, Codecov, Minimal R version, CRAN status, CRAN downloads, Github stars and forks, Package rank, rdocumentation, current version of your package and last change of "README.Rmd". |
Authors: | Roel M. Hogervorst [cre, aut] |
Maintainer: | Roel M. Hogervorst <[email protected]> |
License: | GPL-3 |
Version: | 0.2.0.9000 |
Built: | 2025-02-14 05:42:25 UTC |
Source: | https://github.com/RMHogervorst/badgecreatr |
Adds codecov badge
badge_codecov(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
badge_codecov(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
ghaccount |
Github account name |
ghrepo |
Github repository name |
branch |
branch name such as master, develop etc |
location |
defaults to current location |
markdown
Other badges: badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_codecov(ghaccount = "johntest", ghrepo = "yourreponame", branch = "master")
badge_codecov(ghaccount = "johntest", ghrepo = "yourreponame", branch = "master")
Shows the version number of the package on CRAN, or “not published” if the package is not published on CRAN. See https://r-pkg.org/services#badges One of the metacran badges.
badge_cran(packagename)
badge_cran(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_cran("dplyr")
badge_cran("dplyr")
CRAN time ago released
badge_cran_ago(packagename)
badge_cran_ago(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_cran_ago("dplyr")
badge_cran_ago("dplyr")
CRAN release date of current version.
badge_cran_date(packagename)
badge_cran_date(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_cran_date("dplyr")
badge_cran_date("dplyr")
Display the number of downloads from CRAN. Use last-week, last-day, or grand-total, defaults to montly.
badge_cran_downloads(packagename, period = NULL)
badge_cran_downloads(packagename, period = NULL)
packagename |
name of the package |
period |
defaults to month, other options are last-week, last-day, grand-total |
markdown
badge_cran_downloads("dplyr", period = "last-week")
badge_cran_downloads("dplyr", period = "last-week")
See https://r-pkg.org/services#badges One of the metacran badges.
badge_cran_version_ago(packagename)
badge_cran_version_ago(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_cran_version_ago("dplyr")
badge_cran_version_ago("dplyr")
CRAN version and date of release
badge_cran_version_release(packagename)
badge_cran_version_release(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_cran_version_release("dplyr")
badge_cran_version_release("dplyr")
Add a Github fork badge
badge_github_fork(ghaccount = NULL, ghrepo = NULL, location = ".")
badge_github_fork(ghaccount = NULL, ghrepo = NULL, location = ".")
ghaccount |
Github account name |
ghrepo |
Github repository name |
location |
defaults to current location |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
Add a Github star badge
badge_github_star(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
badge_github_star(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
ghaccount |
Github account name |
ghrepo |
Github repository name |
branch |
branch name such as master, develop etc |
location |
defaults to current location |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
Will add a badge containing the current date that changes on every reknitting. This is a simple pasting of r-code.
badge_last_change(location = ".")
badge_last_change(location = ".")
location |
defaults to working directory |
Rmarkdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
Will add current day to the repo. This function will not change when you reknit the readme. If you want that you will have to use the linklast_change_badge function.
badge_last_change_static(date = NULL)
badge_last_change_static(date = NULL)
date |
if NULL/empty current date. otherwise use yyyy-mm-dd format |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
when ‘license= NULL’ this function will look in your DESCRIPTION file and search for the "license:" part. If it matches GPL or MIT a custom badge will be created. If it does not match, a general badge will be created with the name of the license in grey.
badge_license(license = NULL, location = ".")
badge_license(license = NULL, location = ".")
license |
License, for example |
location |
defaults to current directory |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
Lifecycle denotations were introduced by the tidyverse team in 2018. Because project status was not a perfect fit. I think it is a real professional attitude, the badges communicate to your users what they can expect.
badge_lifecycle(lifecycle = "experimental")
badge_lifecycle(lifecycle = "experimental")
lifecycle |
one of the lifecycle issues |
Maturing - The API of a maturing package has been roughed out, but finer details likely to change. Once released to CRAN, we will strive to maintain backward compatibility, but the package needs wider usage in order to get more feedback and find the optimal API. Stable - In a stable package, we are largely happy with the API, and major changes are unlikely. This means that the API will generally evolve by adding new functions and new arguments; we will avoid removing arguments or changing the meaning of existing arguments. Retired - A retired package is no longer under active development, and a known better alternative is available. We will only make the necessary changes to ensure that retired packages remain on CRAN. No new features will be added, and only the most critical of bugs will be fixed. Archived - The development of an archived package is complete, and it has been archived on CRAN and on GitHub. Dormant - A dormant package is not completed, but is not currently under active development. We plan to return to it in the future. Questioning - We are no longer convinced that a questioning package is the optimal approach, but we don’t yet know what a better approach is.
Display the minimal R version
badge_minimal_r_version(chunk = TRUE)
badge_minimal_r_version(chunk = TRUE)
chunk |
places a r chunk in the readme |
markdown
Rmarkdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_minimal_r_version()
badge_minimal_r_version()
Place a badge with the version of your package which is automatically read from your description file.
badge_packageversion(chunk = TRUE)
badge_packageversion(chunk = TRUE)
chunk |
this argument places a RMarkdown chunk |
Rmarkdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_packageversion()
badge_packageversion()
Project-status is based on the repo-status project on https://www.repostatus.org/. A project-status badge gives a clear indication of the current state of a project. This helps answer questions about development (whether or not further development is planned) and support (whether bugfixes and user assistance will be given).
badge_projectstatus(status = "concept")
badge_projectstatus(status = "concept")
status |
one of concept, wip, suspended, abandoned, active, inactive, unsupported, or moved |
markdown
The following list is a literal copy of repostatus.org
Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept.
WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.
Suspended – Initial development has started, but there has not yet been a stable, usable release; work has been stopped for the time being but the author(s) intend on resuming work.
Abandoned – Initial development has started, but there has not yet been a stable, usable release; the project has been abandoned and the author(s) do not intend on continuing development.
Active – The project has reached a stable, usable state and is being actively developed.
Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.
Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired.
Moved - The project has been moved to a new location, and the version at that location should be considered authoritative. This status should be accompanied by a new URL.
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
badge_projectstatus("unsupported")
badge_projectstatus("unsupported")
If this is something you care about, you can add the current rank of your package to your readme.
badge_rank(packagename)
badge_rank(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rdocumentation
,
badge_thanks_md
, badge_travis
Add a documentation badge, from DataCamp.
badge_rdocumentation(packagename)
badge_rdocumentation(packagename)
packagename |
the name of your package |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
, badge_thanks_md
,
badge_travis
badge_rdocumentation("dplyr")
badge_rdocumentation("dplyr")
Add a thanks badge and THANKS.md file to your project.
badge_thanks_md(add_file = TRUE)
badge_thanks_md(add_file = TRUE)
add_file |
Should the badge add the THANKS.md file to your project? |
markdown
https://github.com/paulmolluzzo/thanks-md
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_travis
Travisbadge creates travis badge.
badge_travis(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
badge_travis(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
ghaccount |
Github account name |
ghrepo |
Github repository name |
branch |
branch name such as master, develop etc |
location |
defaults to current location |
markdown
Other badges: badge_codecov
,
badge_cran_ago
,
badge_cran_date
,
badge_cran_version_ago
,
badge_cran_version_release
,
badge_cran
,
badge_github_fork
,
badge_github_star
,
badge_last_change_static
,
badge_last_change
,
badge_license
,
badge_minimal_r_version
,
badge_packageversion
,
badge_projectstatus
,
badge_rank
,
badge_rdocumentation
,
badge_thanks_md
badge_travis(ghaccount = "johntest", ghrepo = "yourreponame", branch = "master")
badge_travis(ghaccount = "johntest", ghrepo = "yourreponame", branch = "master")
Create badges in your readme file on top of a github repository. This package creates badges for a wide range of functions.
You can place a fixed set of functions in your readme, add badges only or add interactive versions with embedded R-code that changes when you re-knit your badges.
for internal use. used within licensebuilder
badgepaste(imagelink, referlink, name = "license")
badgepaste(imagelink, referlink, name = "license")
imagelink |
link to image file |
referlink |
link to where to send to on click |
name |
what to call the button |
markdown
This is the main function to add badges to your readme.
badgeplacer(location = ".", status = "active", githubaccount = NULL, githubrepo = NULL, branch = NULL, name = "README.Rmd")
badgeplacer(location = ".", status = "active", githubaccount = NULL, githubrepo = NULL, branch = NULL, name = "README.Rmd")
location |
folder where readme.rmd resides |
status |
one of: "concept", "wip", "suspended", "abandoned", "active", "inactive", or "unsupported" |
githubaccount |
your githubname |
githubrepo |
your githubrepositoryname |
branch |
master, develop, etc. |
name |
which file to place badges in, defaults to README.Rmd |
readme file with added badges
This function returns markdown that you must place in the readme. This is dynamic content. This function returns a RMarkdown piece that does some calculation and a set of badges are placed underneath the code part.
dynamic_badges_minimal(status = "concept", license = NULL, last_change = TRUE, minimal_r_version = TRUE, travisfile = NULL, codecov = NULL, location = ".")
dynamic_badges_minimal(status = "concept", license = NULL, last_change = TRUE, minimal_r_version = TRUE, travisfile = NULL, codecov = NULL, location = ".")
status |
one of concept, wip, suspended, abandoned, active, inactive or unsupported |
license |
one of GPL-3, GPL-2, MIT, or CC0. |
last_change |
adding a last change badge? TRUE or FALSE |
minimal_r_version |
adding minimal r version badge? TRUE or FALSE |
travisfile |
add a travis statusbadge |
codecov |
add a codecov badge |
location |
defaults to current location |
text to put into rmd file
Other scenarios: minimal_badges
## Not run: dynamic_badges_minimal(status = "active",last_change = FALSE,minimal_r_version = FALSE) ## End(Not run)
## Not run: dynamic_badges_minimal(status = "active",last_change = FALSE,minimal_r_version = FALSE) ## End(Not run)
README.Rmd
documentWhat badges are already found in the README.Rmd
document
findbadges(location = ".", name = "README.Rmd")
findbadges(location = ".", name = "README.Rmd")
location |
where should we search for |
name |
which file to place badges in defaults to |
list of locations inside of readme
Returns github accountname, repo name and current branch.
github_credentials_helper(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
github_credentials_helper(ghaccount = NULL, ghrepo = NULL, branch = NULL, location = ".")
ghaccount |
Github account name |
ghrepo |
Github repository name |
branch |
branch name such as master, develop etc |
location |
defaults to current location |
Add license badge
licbadgebuilder(licensetype)
licbadgebuilder(licensetype)
licensetype |
one of GPL-3, GPL-2, MIT, or CC0. |
markdown
badgecreatr:::licbadgebuilder("GPL-3")
badgecreatr:::licbadgebuilder("GPL-3")
Returns markdown to manually place in your readme.Rmd file. This is a function you might want to use in the early stages of your project. This function returns badges linkprojectstatusbadge, link(licensebadge), and link(last_change_badge_static).
minimal_badges(status = "concept", license = NULL, date = NULL)
minimal_badges(status = "concept", license = NULL, date = NULL)
status |
one of concept, wip, suspended, abandoned, active, inactive or unsupported |
license |
one of GPL-3, GPL-2, MIT, or CC0. |
date |
a date of your choosing, defaults to current date. |
text to put into rmd
Other scenarios: dynamic_badges_minimal
minimal_badges("abandoned", "GPL-3")
minimal_badges("abandoned", "GPL-3")
a function that checks the remote branches and returns their names.
search_git(location = ".")
search_git(location = ".")
location |
defaults to current location |