12

I'm trying to create a "clickable" image in AsciiDoc lightweight markup language with Asciidoctor.

I tried the following (not working): image::<url1>[<url2>[]]

For example:

image::https://img.shields.io/badge/License-Apache%202.0-blue.svg[http://www.apache.org/licenses/LICENSE-2.0[]]

It should become roughly the following html:

<a href="http://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> 

How can I accomplish this in AsciiDoc without passing through raw HTML?

CouchDeveloper
  • 18,174
  • 3
  • 45
  • 67

1 Answers1

34

block:

image::https://img.shields.io/badge/License-Apache%202.0-blue.svg[link="http://www.apache.org/licenses/LICENSE-2.0"]

inline:

image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[link="http://www.apache.org/licenses/LICENSE-2.0"]

Notice the link attribute on the image.

LightGuard
  • 5,298
  • 19
  • 19