Linking to other Wiki pages on GitHub?

Github

Github Problem Overview


GitHub wikis allow you to link to other pages in the wiki like so:

[[Wiki Page Name]]

However, I want to display different text than the wiki page name when making the link. Is there a way to do this? Am I linking to wiki pages all wrong?

Github Solutions


Solution 1 - Github

Using the Markdown link syntax

[Link Text](WikiPage)

seems to work in the edit preview but not on the actual wiki page. At least for me the generated link is WikiPage instead of wiki/WikiPage and I get the famous GitHub 404.

However the MediaWiki syntax

[[Link Text|WikiPage]]

works for me, even for Markdown wiki pages.

Solution 2 - Github

GitHub by default uses Markdown syntax for the wikis so you can just do:

[Arbitrary Link Text](Wiki Page Name)

Check out Markdown and this blog post for more information about their wikis and the other markup syntaxes they support.

This solution has issues when you're on the home page because it creates relative URLs. Check out Sven's answer, below.

Solution 3 - Github

The internal-ref part is relative to your project. For wiki pages use:

[Page Name](wiki/Page-Name)

In the preview the link will be broken but when the page is saved it will work.

Solution 4 - Github

Check the wiki editor's help. It tells you:

> To create a reference link, use two sets of square brackets. [my internal link][internal-ref] will link to the internal reference internal-ref.

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
QuestionTaylorOtwellView Question on Stackoverflow
Solution 1 - GithubSven JacobsView Answer on Stackoverflow
Solution 2 - GithubcbleyView Answer on Stackoverflow
Solution 3 - GithubBrettView Answer on Stackoverflow
Solution 4 - GithubTekkubView Answer on Stackoverflow