manske
manske

Reputation: 181

How do you create a relative image link w/ GitHub Flavored Markdown?

I'm working with GFM for a series of Github wikis that will need to function across repos. I have no issue embedded relative images [[/path/to/image.png]] or creating relative links [[Link Text|Relative-link]], but I've not been able to figure out how to combine the two to create a link out of the image. Any ideas?

The output I'm looking for is:

<a href="/path/to/link">
    <img src="/path/to/image.png" />
</a>

Upvotes: 1

Views: 1502

Answers (1)

GabrielOshiro
GabrielOshiro

Reputation: 8312

Two ways of doing it:

  1. Using a reference link

    [[[/images/gravatar.jpeg]]][1]
    [1]: http://www.inf.ufrgs.br
    
  2. Using a link directly

    [[[/images/gravatar.jpeg]]](http://www.inf.ufrgs.br) 
    

The logic behind is that we use double brackets to wrap an image and one extra to wrap a link. Here is an example.

Upvotes: 2

Related Questions