port5432
port5432

Reputation: 6371

Link github wiki to trunk code

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

Upvotes: 5

Views: 4737

Answers (1)

VonC
VonC

Reputation: 1323165

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.

Upvotes: 11

Related Questions