Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to a line Markdown file on GitHub

Tags:

github

I often link to GitHub source code via the #L param in the URI.

e.g. : https://github.com/github/learn.github.com/blob/gh-pages/episodes.yaml#L1

But is there a way to link to lines within a Markdown file?

e.g. https://github.com/github/learn.github.com/blob/gh-pages/README.md#L1 (does not work!)

I know I can link to 'sections', but lines are much better!

e.g. https://github.com/github/learn.github.com/blob/gh-pages/README.md#learngithubcom

like image 888
Ian Vaughan Avatar asked Jan 17 '13 22:01

Ian Vaughan


People also ask

How do I link a markdown in GitHub?

You can also create a Markdown hyperlink by highlighting the text and using the keyboard shortcut Command + V . If you'd like to replace the text with the link, use the keyboard shortcut Command + Shift + V .

How do I link to another line in markdown?

Markdown syntax for a hyperlink is square brackets followed by parentheses. The square brackets hold the text, the parentheses hold the link.

How do you add a link to a readme Md file?

To link inline, type the text you want to link within brackets, "[x]", followed directly by the link URL parentheses, "(y)". Reference-style linking allows you to give a link a number or "name" and refer to it multiple times.

How do I attach a file in markdown?

You can now attach files, including images, to markdown files while you're editing them in the web. This works just like file attachments in issues and pull requests and supports the same file types. Just drag and drag, click and select, or paste.


1 Answers

As it is currently not possible, I take the next best option: use blame and then highlight the lines, e.g. https://github.com/rails/rails/blame/master/guides/source/configuring.md#L166

like image 165
lulalala Avatar answered Oct 11 '22 20:10

lulalala