5

In an Github wiki it is possible to embed code. Is it possible to link to source code via a filename (and line number?) from within the wiki's repo?

Ideally there would also be some type of error displayed if the referenced file was later deleted.

I looked at these issues, but they do not cover it:

Linking to other Wiki pages on GitHub?

GitHub link from Issue to Wiki

Community
  • 1
  • 1
port5432
  • 5,491
  • 9
  • 54
  • 89

1 Answers1

11

The wiki markdown-cheatsheet does show a link to a source file (in a wiki page).

You can use a simple http link, which means you can reference any file, with line number directly in that url.

[text](https://github.com/adam-p/markdown-here/blob/master/utils/i18n.js#L11-L12)

Or you can use a relative path

[I'm a relative reference to a repository file](../blob/master/LICENSE)

But in that last case, the line numbers might not work.

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755