github link to wiki page from README

Github

Github Problem Overview


How do I create a link from a README.md file to a Wiki page in github? Every example seems to show linking from one wiki page to another wiki page, or from one README file to another file in the repository. But none that show linking from one to the other

Github Solutions


Solution 1 - Github

I just came across this question and saw that this was impossible, but stubbornly kept trying anyway. Good news, because this actually can be done with relative links!

If you look at the documentation for relative links on GitHub, you can see that it supports ./ and ../ operands.

Given that your README is located at:

https://github.com/<user-name>/<repo-name>/blob/master/README.md

... and the wiki is located at:

https://github.com/<user-name>/<repo-name>/wiki

... that means you can just crawl back from the README to the wiki, like so:

[My Awesome Wiki](../../wiki)


Update: As some people have pointed out in the comments (thanks!), please be aware that these relative links will break on clones and forks, so be sure to weigh that into your decision!

Solution 2 - Github

You would have to use an absolute URL as opposed to a relative one.

For example:

[Sites Using React](https://github.com/facebook/react/wiki/Sites-Using-React)

Solution 3 - Github

I found that I needed to crawl back 3 levels versus 2 levels as descreibed in jmar777's approach.

When I used

../../wiki

The link generated was https://github.com/<username>/blob/wiki

I needed to use:

../../../wiki

This generated https://github.com/<username>/wiki

Solution 4 - Github

I am using GitLab. My link to my Wiki page looks like this.

Checkout the [Wiki page](/%2E%2E/wikis/Welcome)

I tried the other recommendations that are posted here but it kept changing the URL with re-writes that broke the link.

Solution 5 - Github

Just to add on this one, if you want to refer to your repo file from inside wiki use ../../blob/master/. Combined with the answer from jmar777 this allows to completely integrate code and wiki and remove a need for bloated readme.md.

To make it work locally as well as your file structure would have to be

./Wiki/YourWikiRepo
./blob/master/YourCodeRepo

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionveiligView Question on Stackoverflow
Solution 1 - Githubjmar777View Answer on Stackoverflow
Solution 2 - GithubmaxdeviantView Answer on Stackoverflow
Solution 3 - GithubGrendelView Answer on Stackoverflow
Solution 4 - GithubLinuxGuruView Answer on Stackoverflow
Solution 5 - GithubDfACView Answer on Stackoverflow