ToC or sidebar in the GitHub Wiki

How to create a ToC or sidebar menu on a GitHub wiki?

I saw some mention of this and gollum that seem to support it, but how to do this in the current GitHub project?

Best based on the headings that I have on the page.

These links mention this, but do not show how to do it:

+66
github wiki
Feb 11 2018-12-12T00:
source share
7 answers

Good. Let me understand if I understand this correctly:

  • Cloning your github wiki. (Theres a Git section on the wiki. You can check your wiki-like code.)
  • Create _Sidebar.md
  • In regular wiki pages, use [[link]] for the sidebar
  • Commit and return to github

This process is pain in the ass. Im surprised that this "gollum" wiki has recognition.

Also: _Sidebar.md is global for all pages. I would have to organize my wiki in folders, so I can define different sidebars for different pages.

+19
Feb 17 '12 at 11:40
source share

While your solution is working, there is an easier way to do this using the GitHub web interface. You can simply create a page called _Sidebar and / or _Footer .

See detailed instructions in ADDING CONTENTS TO YOUR WIKI GITUM .

+73
Apr 09 2018-12-12T00:
source share

When you are in the wiki of your project, there is a link Add a custom sidebar . Click this.

Enter image description here

You now have a page that you are editing, since you are editing any other Markdown page. To do the table of contents, you must do it manually, though. There is no automated method (as of August 2014). For example:

 # My menu * [Home][home] * [Technical documentation][techdocs] * [User manual][usermanual] [home]: https://github.com/myproject/wiki/Home [techdocs]: https://github.com/myproject/wiki/Technical-documentation [usermanual]: https://github.com/myproject/wiki/User-manual 
+14
Aug 14 '14 at 9:17
source share

Please note that the original question was whether to create a sidebar (simple, solved in the answers) or the actual table of contents (did not answer).

One thing I can say is that the wiki gollum 2.1 syntax allows you to use the [[_TOC_]] tag, but the GitHub wiki does not recognize this (yet?).

+10
Dec 29 '13 at 10:41
source share

I think this is described in the Gollum README . (See Header and Sidebar Sections.)

Essentially, you create _footer.ext and _sidebar.ext in a directory containing the contents of the page.

+4
Feb 11 2018-12-11T00:
source share

I just created a Python script that generates an index in _Sidebar.md GitHub based on the structure of folders and pages in wiki git.

Enter image description here

+3
Nov 26 '15 at 12:47
source share

I implemented the npm github-wiki-sidebar module to help github users easily create and maintain sidebar menus.

Source and result: https://raw.githubusercontent.com/wiki/adriantanasa/github-wiki-sidebar/images/github-wiki-sidebar-generator.png

Source pages (as shown in the Wiki admin):

 Home Installation Roadmap Usage Usage: Command line modifiers Usage: Init Mode 

Result (with individual order):

Prerequisite:

  • localize the local github wiki repository (displayed in the lower right corner of the Wiki interface)
  • install github-wiki-sidebar

     git clone <https://github.com/<username>/<my-project-name>.wiki.git npm install -g github-wiki-sidebar 

Create / update your wiki menu:

  • create new pages / rename pages on your github.com wiki admin
  • execute locally github-wiki-sidebar script in your wiki repository folder

     cd /path/to/<my-project-name>.wiki # this fetches latest changes, generates sidebar file (_Sidebar.md) and pushes changes to github github-wiki-sidebar --git-push 

The module allows you to customize the display of labels, including the order of the elements, the separator of categories, the template for the menu, the format of links and others.

0
Dec 11 '17 at 12:49 on
source share



All Articles