Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to display all sub wikis in an index page in gitlab?

Tags:

gitlab

wiki

So in gitlab you can use [[_TOC_]] to display a table of contents for the current page - which works on headings.

But I want to have a heirachy in my wiki like:

<home-url>/Project1
<home-url>/Project1/Tools
<home-url>/Project1/Debugging
<home-url>/Project1/Debugging/GDB
<home-url>/Project1/Debugging/MSVS

Such that in the Project1 page I get an index (links) to each section similar to the table of contents layyout - e.g.:

 - Tools
 - Debugging
    - GDB
    - MSVS

I can do this manually, but that's a pain to maintain. Is there some automatic tool to do this for me like TOC?

like image 657
code_fodder Avatar asked Oct 27 '20 12:10

code_fodder


People also ask

Where are GitLab wiki files stored?

Where files are stored. Attach a file, and GitLab stores it according to your installed version of GitLab: Files added in GitLab 11.3 and later: Files are stored in the wiki's Git repository. Files added GitLab 11.2 and earlier: Files are stored in GitLab itself.

Does GitLab have a wiki?

GitLab's application offers functionality to collaboratively plan, build, secure, and deploy software as a complete DevOps Platform. GitLab is scalable and can be hosted on-premises or on cloud storage. It also includes a wiki, issue-tracking, IDE, and CI/CD pipeline features.


Video Answer


2 Answers

The TOC support steams from issue 2494, and was implemented in issue 21901, which gave us the Markdown [[_TOC_]] syntax.

Even the current request to support [TOC] instead (issue 14193) does not mention any layout option to include a hierarchical display.

As mentioned in the first issue:

If you need more control, you can open a new issue at https://gitlab.com/gitlab-org/gitlab/issues and upvote it.

For example: issue 215988: "Add Gollum depth level support for Wikis Table of Contents [[_TOC_]]"

Having the ability to limit a [[TOC]] depth is useful to show a more synthetic view of a page while keeping its deeply nested structure.


See also GitLab 15.3 "Visualize table of contents in the WYSIWYG wiki editor".

like image 142
VonC Avatar answered Oct 19 '22 21:10

VonC


Thanks to VonC for the actual answer - i.e. there is not such a feature at the moment (well, not quite as I want it) - but there is the side bar in gitlab wiki which shows you the pages within your wiki.

If you structure you wiki into folders and subfolders then you can navigate with this side bar "tree". Its not collapseable - so its just a bog-roll off text, but it is indented to aid navigation.
It works well enough for simple wikis with a few dozen pages - but probably if there are hundreds of pages it might start to breakdown - at that point you might want to break your wiki up into several wikis with a top-level links page or some such.

Here is (a crap) picture - it was the best I could see on google without looking too hard see here

menu

You get this for free (without doing anything) so its decent for most cases.

like image 45
code_fodder Avatar answered Oct 19 '22 19:10

code_fodder