Create Badges for 'Travis', 'Repostatus' 'Codecov.io' Etc in Github Readme

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".


Project Status: Active The project has reached a stable, usable state and is being actively developed. Licence codecov minimal R version CRAN_Status_Badge packageversion Last-changedate Status Master branch: Build Status

Status Develop branch: Build Status

This package was inspired by the badgerbadger package that checks for badges of travis, code coverage open issues, dependencies and licenses. It would be nice to have a simple function that adds these things to a readme.rmd file in R. It will save you typing and searching for the exact markdown on the websites of travis, codecov, repostatus.org etc.

This package does now place the following badges /shields:

  • [x] repo status according to https://www.repostatus.org/
  • [x] licence (recognize from DESCRIPTION file)
  • [x] travis shield
  • [x] code coverage
  • [x] minimal R version (recognize from DESCRIPTION file)
  • [x] cran badge
  • [x] packageversion (recognize from DESCRIPTION file)
  • [x] last change (this will automagically update everytime you knit your readme.rmd)
  • [x] finds github account and reponame automatically
  • [x] finds local repo
  • [x] nr of open issues
  • [x] number of pull requests
  • [x] rdocumentation badge

Possible future badges

  • [x] number of downloads CRAN
  • [ ] number of dependencies and:
  • [ ] a way to visualize their version
  • [ ] project lifecycle badge as used by tidyverse

Other changes initiatilzation on readme.md only (without active components)

Workflow

I like to use the following workflow:

  • start a new project in rstudio
  • after some functions are made start a package
  • start a github repo
  • create a readme.rmd
  • ( this is where badgecreatr comes in) create badges
  • continue with the project
  • submit to cran, bioconductor, ropensci etc

You will probably call badgecreatr only once, somewhere during your work.

If you call badgecreatr again when you already have badges, they will be recognized. [(see NEWS)]](NEWS.md)

Installation

badgecreatr is on CRAN, install using install.packages("badgecreatr"). But is has a flaw that I have fixed in the dev version.

The newest 'developmental' version is installed with devtools::install_github("rmhogervorst/badgecreatr")

Use

You can use this package in multiple ways: add a bunch of badges at once with badgecreatr::badgeplacer(), or you can add the badges with seperate commands, I have named them all badge_* so that autocomplete will make it much easier for you to find the correct one. See the vignette about scenarios of use for more info.

Contact

Want to help or have questions? Contact me directly, use an issue, fork me or submit a pull request.

star this repo fork this repo

Inspiration

I found the projectstatus https://www.repostatus.org/ and the wonderful shields.io projects and wanted to implement that for all my packages. But that took a lot of work. Repetitive work, and I don't like that.

The badgerbadgerbadger project in ruby did all these things automatically. I wanted to do the same thing for R projects. And I did.

News

Change Log

All notable changes to this project will be documented in this file. This project tries to adhere to Semantic Versioning.

[Unreleased]

Added

Removed

Deprecated

0.2.*

unpublished yet,

This version of badgecreatr has breaking changes with previous versions. It was a major overhaul of the badgecreatr package with help from Florian Privé, Stephanie Locke, and Andrie de Vries. I realized I never used the package as I originally intended, but I usually added one or two badges by name. So I have exported all the functions for interactive use. And added new badges. To help others I have added a vignette that describes how to add new badges.

Added

  • R-version badge will be updated when you re-knit the readme.rmd to readme (thanks Florian PrivĂ© @privefl)
  • Vignette that explains badges
  • Badge for r-documentation
  • Badges for github stars and github forks.
  • Badge for last-change without R code (static)
  • All badges can be added individually and start with badge_*: badge_projectstatus, badge_travis, badge_codecov , badge_minimal_r_version, badge_cran, badge_packageversion, badge_last_change, badge_last_change_static, badge_rdocumentation, badge_github_star, badge_github_fork, badge_licence, badge_rank, badge_cran_*
  • Badge for package rank
  • Badge for CRAN downloads
  • Badge for CRAN release variants, from metacran (r-pkg.org)
  • Vignette extending badgecreatr
  • Added 'moved' as an option in project status badge. (Although you still need to modify that link.)
  • set default project_status to "concept"
  • cran_comments.md
  • badge_thanks for adding a THANKS.md badge based on https://github.com/paulmolluzzo/thanks-md
  • added badge_lifecycle, a literal copy of the tidyverse.org/lifecycle badges.

Removed

  • dependency on stringr Thanks to Andrie de Vries (@andrie )

Deprecated

  • old function names ending in *badge: projectstatusbadge, travisbadge, codecovbadge, minimal_r_version_badge, cranbadge, packageversionbadge, and last_change_badge. The use of the word licence (I have changed all the words to the spelling "license", US spelling)

Fixed

  • when you rerun the command, no superflous lines will be added.
  • searches for licence badge and codecov badge didn't work. tx Stephanie Locke @steplocke for both these fixes.
  • added location for all badges so that the badges can be used in other locations and not only in the top folder.
  • Use only base R - remove dependency on stringr
  • Use read.dcf() to read DESCRIPTION
  • Simplify github access functions using git2r Thanks Andrie de Vries @andrie for these huge improvements
  • renamed changelog to news

Security

  • none

0.1.0

2016-07-03

Added

  • r version badge
  • changed the search results for badges into TRUE FALSE in stead of linenumber.
  • existing badges will be recognized and not duplicated.

Removed

  • nothing

Deprecated

  • nothing

Fixed

  • recognition of badges already placed.

Security

  • nothing

0.0.2

2016-07-02

Currently creates badges for Codecov, last change, travis, projectstatus and licence.

Added

  • Codecov badge
  • last change
  • travis
  • projectstatus
  • cran
  • packageversion

Removed

-nothing

Deprecated

  • nothing

Fixed

  • nothing

Security

  • nothing

0.0.1

2016-06-24

Added

Started project with readme and several functions

Removed

  • nothing

Deprecated

  • nothing

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("badgecreatr")

0.2.0 by Roel M. Hogervorst, 2 months ago


https://github.com/RMHogervorst/badgecreatr, https://rmhogervorst.nl/badgecreatr


Report a bug at https://github.com/RMHogervorst/badgecreatr/issues


Browse source code at https://github.com/cran/badgecreatr


Authors: Roel M. Hogervorst [cre, aut]


Documentation:   PDF Manual  


GPL-3 license


Imports git2r

Suggests testthat, rmarkdown, knitr


See at CRAN