Take character vectors of alternative text, image link destinations, and
optional titles and return single glue vector of valid markdown inline image
links. This inline is rendered as the <img>
HTML tag. Note that the
expected arguments of md_image()
are reversed from md_link()
md_image(url, alt = "", title = NULL, ..., .name = FALSE)
A character vector of link destination (URL) strings.
A character vector of alternative text that can be used to refer to an image.
The optional title of the link.
A sequence of alt = "/url"
named vector pairs. If any such
pairs are provided, .name
will be considered TRUE
.
logical; if TRUE
, the pairs in ...
will be used instead of
any values supplied to x
and url
.
A glue
vector of collapsed display text and associated URLs.
A glue
vector of collapsed alternative text and associated URLs.
Syntax for images is like the syntax for links, with one difference. Instead
of link text, we have an image description. The rules for this are the same
as for link text, except that (a) an image description starts with ![
rather than [
, and (b) an image description may contain links. An image
description has inline elements as its contents. When an image is rendered to
HTML, this is standardly used as the image’s alt
attribute.
Other inline functions:
md_autolink()
,
md_bold()
,
md_code()
,
md_convert()
,
md_disallow()
,
md_escape()
,
md_hardline()
,
md_issue()
,
md_italic()
,
md_link()
,
md_softline()
,
md_strike()
,
md_text()
if (file.exists("man/figures/logo.png")) md_image("man/figures/logo.png")
md_image("http://hexb.in/hexagons/eff.png")
#> ![](http://hexb.in/hexagons/eff.png)
md_image(EFF = "http://hexb.in/hexagons/eff.png")
#> ![EFF](http://hexb.in/hexagons/eff.png)
md_image("http://hexb.in/hexagons/eff.png", "EFF Hex Sticker", "Logo")
#> ![EFF Hex Sticker](http://hexb.in/hexagons/eff.png "Logo")