Search code examples
githubwikigithub-flavored-markdown

ToC or Sidebar in GitHub Wiki


How do I create a ToC or a sidebar menu in a GitHub Wiki?

I saw some mentions of it and gollum the backend seems to support it, but how do I do it in a current GitHub project?

It should best be based on the headers I have in the page automatically.

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


Solution

  • Okay. Let me see if I understand this correctly:

    1. Clone your GitHub wiki. (There’s a Git section in the wiki. You can checkout your wiki-like code.)
    2. Create _Sidebar.md
    3. In normal wiki pages, use [[link]] for the sidebar
    4. Commit and push back to GitHub

    This process is a pain in the ass. I’m surprised this “gollum” wiki has any acceptance.

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