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
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 .
Markdown syntax for a hyperlink is square brackets followed by parentheses. The square brackets hold the text, the parentheses hold the link.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With