3

I have an image in markdown:

![Tabs](https://raw.github.com/dbpedia/DBpedia-Spotlight-Dashboard/main/images/doc/1_tabs.png)

How can I reference that image like:

[Figure 2](-reference-) shows the 4 main tabs of the dashboard

Hope you can help me. Thanks in advance.

rayqz
  • 249
  • 1
  • 8

2 Answers2

2

With Github markdown, you can use HTML tag a, set with the name on the object and href

On the object/image:

<a name="tabs">![Tabs](https://raw.github.com/dbpedia/DBpedia-Spotlight-Dashboard/main/images/doc/1_tabs.png)</a>

On the link text:

<a href="#tabs">Figure 2</a>

You may need to define unique name for every components and also unique among the headings.

Dhana D.
  • 1,670
  • 3
  • 9
  • 33
0

You might be able to use html to create an anchor: see

https://stackoverflow.com/a/62058879/341994

But I doubt that this will work, because GitHub sanitizes your html and will probable neutralize the anchor. In that case, the answer is that what you're trying to do is impossible using the tool you're using.

Personally, I use kramdown to generate raw html from Markdown. That way, I can do the sort of thing you're after.

matt
  • 515,959
  • 87
  • 875
  • 1,141