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

后端 未结 9 614
孤城傲影
孤城傲影 2021-01-30 02:05

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

9条回答
  •  不思量自难忘°
    2021-01-30 02:39

    One possible (semi-automated) solution is Eugene Kalinin's github-markdown-toc. This tool essentially crunches through your README.md file and snarfs out #'s headings to create a TOC.

    1. Download the script https://github.com/ekalinin/github-markdown-toc
    2. Feed your README.md to the script (as noted in Eugene's README.md)

      cat README.md | bash github-markdown-toc

    3. Cut and paste generated TOC and place it at the top of your README.md file

    Note that this bash implementation only works on Linux (from what I can tell).

    As a side note, there is a golang implementation and is probably more of a hassle to get working.

提交回复
热议问题