6

I am trying to find the best way to document my project in Gitlab. And I found two different alternatives:

  • Markdown in the actual repository (my-repo.git)
  • Wiki using markdown (my-repo/wiki.git)

Note that the suffix .git indicates that these are two different git repositories.

I like the approach to simply modify the Wiki using markdown from the webpage (for everyones simplicity), but I am missing how to link between them or any other project in Gitlab.

In the documentation is provided some information to link (issues, commits, etc...) to other projects but not link files like the README.md and other documentation.

Is there such functionality?

aitorhh
  • 2,331
  • 1
  • 23
  • 35

2 Answers2

2

I also don't know if I am 100% getting your question, but Gitlab does support special syntax for referencing other projects/commits/etc..

You can reference other project like so,

namespace/project>

It doesn't support referencing files in other projects (as far as I can tell), but you can reference files in the same project:

[README](doc/README.md)

And to specify a line number:

[README](doc/README.md#L13)
Mr.Zeus
  • 424
  • 8
  • 25
0

I don't know if I get your point to 100%.

Linking to other "files" is like links to any URL / URI in markdown. Use the "well-known" syntax [LinkName](LinkTarget).

A Link inside the same project

[Link to file, relative path](./README.md)  

This should work in WIKIs and Project Markdown-files.

[Link to a file from other project](https://gitlab.com/{{USER or COMPANY}}/{{PROJECT}}/-/blob/master/{{FOLDER}}/README.md)

You can also use the reference syntax for links [LinkName][LinkReference] and then later in your file [LinkReference]: https://gitlab.com/foobar/123 when you want to reuse your links or collect them at the end of your file.

KargWare
  • 1,746
  • 3
  • 22
  • 35