Skip to content

Instantly share code, notes, and snippets.

@royfrancis
Forked from matt-dray/badgr-shiny.R
Created April 18, 2023 11:51
Show Gist options
  • Save royfrancis/6c3847f2dfc6ecdb6a1548cfae665e2a to your computer and use it in GitHub Desktop.
Save royfrancis/6c3847f2dfc6ecdb6a1548cfae665e2a to your computer and use it in GitHub Desktop.
Make a shields.io README badge that links to a Shiny app, using the {badgr} package in R
# Make a README badge for your R Shiny repo
# Matt Dray, March 2021
# {badgr} blog post: https://www.rostrum.blog/2020/05/08/readme-badge/
# Shiny badge blog post: https://www.rostrum.blog/2021/03/23/shiny-badge/
# {badgr} is available from GitHub via {remotes}
install.packages("remotes") # if not already installed
remotes::install_github("matt-dray/badgr") # install {badgr}
# Generate badge URL and wrap in Markdown link
badgr::get_badge(
# Badge label
label = "Shiny", # left-side text
label_color = "white", # left-side colour
# Badge message
message = "shinyapps.io", # right-side text
color = "blue", # right-side colour
# Logo
logo_simple = "RStudio", # named icon from simpleicons.org
logo_color = "blue", # colour of simpleicons.org icon
# Markdown link
md_link = "https://matt.dray.shinyapps.io/randoflag/", # clickable link URL
# Convenience arguments
browser_preview = TRUE, # preview badge in your browser
to_clipboard = TRUE # copies markdown to paste into readme
)
# Paste into your README, or any other (R) Markdown docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment