@@ -36,6 +36,50 @@ use_depsy_badge <- function() {
3636 invisible (TRUE )
3737}
3838
39+
40+ # ' Create a life cycle badge
41+ # '
42+ # ' * Experimental: very early days, a lot of churn in search of a good API.
43+ # ' Not on CRAN. Might not go anywhere. Use with care.
44+ # ' * Maturing: API roughed out, but finer details likely to change. Will strive
45+ # ' to maintain backward compatibility, but need wider usage in order to get
46+ # ' more feedback.
47+ # ' * Dormant: not currently working on it, but plan to come back to in the
48+ # ' future.
49+ # ' * Stable: we're happy with the API, and the unlikely to be major changes.
50+ # ' Backward incompatible changes will only be made if absolutely critical, and
51+ # ' will be accompanied by a change in the major version.
52+ # ' * Questioning: no long convinced this is a good approach, but don't yet
53+ # ' know what a better approach might be.
54+ # ' * Retired: known better replacement available elsewhere. Will remain
55+ # ' available on CRAN.
56+ # ' * Archived: development complete. Archived on CRAN and on GitHub.
57+ # '
58+ # ' @param stage Stage of the lifecycle. See description above.
59+ # ' @export
60+ use_lifecycle_badge <- function (stage ) {
61+
62+ stage <- match.arg(tolower(stage ), names(stages ))
63+ colour <- stages [[stage ]]
64+
65+ url <- paste0(
66+ " https://img.shields.io/badge/lifecycle-" , stage , " -" , colour , " .svg"
67+ )
68+
69+ use_badge(" lifecycle" , url , url )
70+ }
71+
72+ stages <- c(
73+ experimental = " orange" ,
74+ maturing = " blue" ,
75+ stable = " brightgreen" ,
76+ retired = " orange" ,
77+ archived = " red" ,
78+ dormant = " blue" ,
79+ questioning = " blue"
80+ )
81+
82+
3983# ' Use a README badge
4084# '
4185# ' @param badge_name Badge name. Used in error message and alt text
0 commit comments