Learn R Programming

gluedown (version 1.0.2)

md_image: Markdown image links

Description

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.

Usage

md_image(url, alt = "", title = NULL)

Arguments

url

A character vector of link destination (URL) strings.

alt

A character vector of alternative text that can be used to refer to an image.

title

The optional title of the link.

Value

A glue vector of collapsed alternative text and associated URLs.

Details

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<U+2019>s alt attribute.

See Also

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()

Examples

Run this code
# NOT RUN {
if (file.exists("man/figures/logo.png")) md_image("man/figures/logo.png")
md_image("http://hexb.in/hexagons/eff.png")
md_image("http://hexb.in/hexagons/eff.png", "EFF Hex Sticker")
md_image("http://hexb.in/hexagons/eff.png", "EFF Hex Sticker", "Logo")
# }

Run the code above in your browser using DataLab