ToC or Sidebar in GitHub Wiki
While your solution works, there's an easier way to do it using GitHub's web interface. You can simply create a page named _Sidebar
and/or _Footer
.
See detailed instructions in Github Wiki sidebar menu builder with multi-level.
Edit The original article is gone and I can't find it in the cache so I've updated the link.
When you are in the wiki of your project, there is a link Add a custom sidebar. Click that.
Now you have a page that you edit as you would edit any other Markdown page. To make a table of contents you have to do it manually though. There is no automated method (as of August 2014). So 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
Okay. Let me see if I understand this correctly:
- Clone your GitHub wiki. (There’s a Git section in the wiki. You can checkout your wiki-like code.)
- Create
_Sidebar.md
- In normal wiki pages, use
[[link]]
for the sidebar - 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.
Note that the original question was about creating a side bar (easy, solved in the answers) or an actual table of contents (not answered).
One thing I can say is that the gollum 2.1 wiki syntax allows for a [[_TOC_]]
tag, but a GitHub wiki won't recognise that (yet?).