Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link github wiki to trunk code

Tags:

github

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

like image 273
port5432 Avatar asked Feb 12 '23 20:02

port5432


1 Answers

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.

like image 99
VonC Avatar answered Feb 15 '23 08:02

VonC