githubwiki

How do I create some kind of table of content in GitHub wiki?


If you look here: http://en.wikipedia.org/wiki/Stack_Overflow

You'll notice there's a little "Content" section, if you click on one of the links, it will send you to a specific section on the page.

How do I do this in GitHub wiki? With Markdown or whatever they use?


Solution

  • It is nicely demonstrated in the Table of Contents of the Markdown Cheatsheet.

    ##### Table of Contents  
    [Headers](#headers)  
    [Emphasis](#emphasis)  
    ...snip...    
    <a name="headers"/>
    ## Headers
    

    If you hover over a Header in a GitHub Markdown file, you'll see a little link sample to the left of it, you can also use that link. The format for that link is <project URL#<header name>. The <header name> must be all lower case.