I am trying to create links in my README.md that link to example code using a relative path, as opposed to the absolute path I am using now. For example, in the markdown file, if I use this:
[someLabel](https://github.com/username/repoName/somePathTo/myExampleCode)
It works no problem. But I would like to link it up using something like this:
[someLabel](username/repoName/somePathTo/myExampleCode)
This does not link up, as it gives me the ol' 404 not found error. Is there a way to link my examples on Github to my README using a relative path?
External Links 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.
Links. You can create an inline link by wrapping link text in brackets [ ] , and then wrapping the URL in parentheses ( ) . You can also use the keyboard shortcut Command + K to create a link.
Linking to code On GitHub.com, navigate to the main page of the repository. Locate the code you'd like to link to: To link to code from a file, navigate to the file. To link to code from a pull request, navigate to the pull request and click Files changed.
They seem to have changed this since Aug 8 '12
, so now all I had to do to reference my pdf file inside the Documentation
folder (which is in my project's root) is this:
[file.pdf](Documentation/file.pdf)
So, no need to add blog/master
part anymore. Hope it helps new people browsing this question.
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