github Readme - reference issue

GithubMarkdown

Github Problem Overview


How can I reference (insert a relative link to) an issue in my github Readme.md?

I found the following document GitHub Flavored Markdown where it is described how to reference to an issue in a commit, but not in the readme.

E.g. if the Issue is: https://github.com/user/project/issues/5 how can I set a link to it in my readme without using absolute links?

Github Solutions


Solution 1 - Github

There's a pretty ugly way of doing something like that if you only want to refer to issues from the same repo, which as of 2015-04-29 works:

see also [#3](/../../issues/3)

Solution 2 - Github

This is not strictly the solution to your question, but maybe the solution to your problem.

I too wanted to avoid to add absolute URLs to links in my CHANGELOG, because it would make the lines so long and unreadable.

But when using reference style links, it's not too bad:

* [feature] Add an awesome feature ([#33][i33])
* [bug] Finally fixed this stupid bug ([#19][i19])

[i19]: https://github.com/user/repo/issues/19
[i33]: https://github.com/user/repo/issues/33

One of the big advantages is that it also works outside of Github.

Solution 3 - Github

This is not (officially) possible. GitHub Flavored Markdown is not used for rendering markdown files in your repo, it is used only for issues and comments. So, readme files are rendered using normal markdown, and no autolinking will happen for issues, SHAs and similar constructs.

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
QuestionStefan ProfanterView Question on Stackoverflow
Solution 1 - GithubEduardo Pareja TobesView Answer on Stackoverflow
Solution 2 - GithubDanilo BargenView Answer on Stackoverflow
Solution 3 - GithubIvan ZuzakView Answer on Stackoverflow