inst/buttons.R

#' Interactively Create Buttons
#'
#' Interactively Create Buttons.
#'
#' @export
#' @examples
#' \dontrun{
#' github_star("blogtools", "data-steve")
#' }
github_star <- function(pkg, acct="data-steve", size="mega",script=FALSE){
  star <- paste0('<a class="github-button" '
                , 'href="https://github.com/'
                , acct,"/",pkg
                ,' data-icon="octicon-star"'
                ,' data-style="', size
                ,'">',pkg,'</a>',
                ifelse(script,'<script async defer src="https://buttons.github.io/buttons.js"></script>',"" ))
  clipr::write_clip(star)
  cat(star)
}
data-steve/blogtools documentation built on May 14, 2019, 6:17 p.m.