Gitlab Markdown has support for references to files in the repository structure, like:
[README](doc/README)
or
[README](doc/README#L13)
But are there ways to reference files and lines in these files, but from a given commit, at least in the Wiki ?
Maybe something like:
[README](1ab3fa71:doc/README#L13)
or using the file hash id like:
[README](9a27b101#L13)
Create a repository. To create a new repository, all you need to do is create a new project or fork an existing project . Files. Use a repository to store your files in GitLab. ... Host your codebase in GitLab repositories by pushing your... Branches. For details, see Branches . Commits. When you ...
Starting with GitLab 11.3, any file that is uploaded to the wiki via GitLab’s interface will be stored in the wiki Git repository, and it will be available if you clone the wiki repository locally. All uploaded files prior to GitLab 11.3 are stored in GitLab itself.
The reason for this is that, in GitLab, wiki is always a separate Git repository. For example, I'm a reference-style link will point the link to wikis/style when the link is inside of a wiki markdown file. There is, however, a syntax which seems to work currently:
GitLab sets the size limits for GitLab.com . All code contributors are displayed under your project’s Repository > Contributors . The graph shows the contributor with the most commits to the fewest. A repository graph displays a visual history of the repository network, including branches and merges.
To use relative links from wiki to the repository (or wise versa) is not supported officially according to Gitlab's documentation (v11.5):
Note: Relative links do not allow referencing project files in a wiki page or wiki page in a project file. The reason for this is that, in GitLab, wiki is always a separate Git repository. For example, I'm a reference-style link will point the link to wikis/style when the link is inside of a wiki markdown file.
There is, however, a syntax which seems to work currently:
[[README|/../blob/1ab3fa71/doc/README#L13]]
But be aware: all text of the same paragraph will just be lost!
I work around that by phrasing like this, which renders like expected for Gitlab CE v11.3.0 at least:
Here you see xyz:
* [[README|/../blob/1ab3fa71/doc/README#L13]]
The root-anchored link (/../blob/<version>/<path-to-file>
) ensures that it works from every Wiki page independently from their nesting depth.
For sure this syntax also works for branch names or any other relative link like /../tree/1ab3fa71/doc
for example.
Maybe long after the battle, but I found a workaround : Simply make a link to a page where the README.md is. And that's it !
To get the link simply go to a page which displays the document, copy the URL, make a link to that address, append #L with the line number.
Exemple :
[Readme Pelargos](http://192.168.80.250:10080/project-root/android/Pelargos/blob/develop/README.md#L47)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With