get_badge.Rd
Build a URL string that generates a shields.io metadata badge. For convenience, this function allows you to embed the URL in Markdown with a link and copies this to the clipboard for use in a README or elsewhere.
get_badge(
label = "shields.io",
message = "badge",
color = "ff0000",
style = "flat",
label_color = NULL,
md_link = NULL,
link_left = NULL,
link_right = NULL,
logo_simple = NULL,
logo_color = NULL,
logo_width = NULL,
logo_path = NULL,
ext_override = NULL,
browser_preview = TRUE,
include_md = TRUE,
to_clipboard = TRUE
)
Text string to display on the left side of the badge.
Text string to display on the right side of the badge.
The background color of the right side of the badge. Should be one of hex, RGB, RGBA, HSL, HSLA or a CSS named color.
One of "plastic"
, "flat"
, "for-the-badge"
or "social"
. See examples on
shields.io.
The background color of the left side of the badge. Should be one of hex, RGB, RGBA, HSL, HSLA or a CSS named color.
A URL string to be used in your badge's Markdown output. If used, clicking the rendered HTML badge output will take you to this site.
A URL string for the left side of the badge. (Included for
completeness; you probably want md_link
instead)
A URL string for the right side of the badge. (Included for
completeness; you probably want md_link
instead)
Text string that names a logo from
simple-icons.org to be placed on the
far left of the badge. (Use either a named logo with logo_simple
or a custom logo with logo_path
; not both.)
A color for the logo specified by logo_simple
.
Horizontal spacing width around the logo.
URL string for your custom logo image. (Use either a named
logo with logo_simple
or a custom logo with logo_path
; not
both.)
Provide a file extension that overrides the one in
logo_path
. (For example, you could specify png
or
gif
if you're using a favicon in ico
format.) You're
unlikely to need this argument.
Do you want to preview the badge in the browser? Requires an internet connection.
Do you want to prepare the URL with Markdown syntax
(![]()
) to allow for direct copying into a Markdown file?
Otherwise you get the bare URL. Use md_link
to add a link to the
badge.
Do you want the string to be copied to your clipboard so you can paste it elsewhere? Will overwrite your current clipboard items.
A Markdown text string.
get_badge(
label = "Label",
message = "Message",
color = "blue",
browser_preview = FALSE,
to_clipboard = FALSE
)
#> [1] "https://img.shields.io/badge/Label-Message-blue?style=flat"