2

I am making a readme file for my GitHub project and need to link to a specific bullet point within a specific section in the readme file. Is this possible?

bj97301
  • 342
  • 1
  • 13

1 Answers1

2

Not directly in Markdown, but you can use an HTML list and add an id to whatever item you want to link to:

<ul>
  <li>Foo</li>
  <li id="bar">Bar</li>
</ul>

Then, you can link to it using that id, e.g.

[Link to Bar](#bar)

<a href="#bar">Link to Bar</a>

Or from another document:

[Link to Bar](https://github.com/bj97301/project/blob/main/README.md#bar)
ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • So no way to do it without the id? I get yelled at for using html . – bj97301 May 06 '22 at 01:10
  • 1
    No, there is no way to do it with just plain Markdown. I suggest you tell whoever "yells at you" for doing this that [inline HTML has been part of Markdown's architecture from the very beginning](https://daringfireball.net/projects/markdown/syntax#html). If you don't want to use it, fine, but that does restrict what you can do. – ChrisGPT was on strike May 06 '22 at 11:53
  • Good point. I’ll look into it. – bj97301 May 07 '22 at 15:33