Is there a way to generate a ToC on a rendered README.md hosted on Github Pages that doesn't require the use of local Jekyll plugins to generate it prior to uploading it to Github Pages?
Press CTRL + SHIFT + P. Select Markdown: Create Table of Contents.
You can create tables by assembling a list of words and dividing them with hyphens - (for the first row), and then separating each column with a pipe | . The final example is not correct because you need at least 3 hyphens as the documentation says. Great answer, thank you.
Tutorials, Tips & Tricks. alexs77 August 16, 2017, 9:23am #1. Some markdown editors (like stackedit.io) support a [TOC] “command”, which will insert/show a Table Of Contents, based on the headlines of the current document.
If you regularly add and delete sections in your README file, it’s even worse because you have to remember to update the table of contents too. The more headings your document has, the worse it gets. It’s not realistic to manually create tables of contents for every GitHub README file. It does work, though. We will focus on that part for right now!
The table of contents on page 1 is what I wanted to recreate in Markdown for my GitHub README. My requirements were simple: Looks neat and organized. Clicking on the name of a section in the table of contents sends you directly to that section in the content itself.
If you regularly add and delete sections in your README file, it’s even worse because you have to remember to update the table of contents too. The more headings your document has, the worse it gets. It’s not realistic to manually create tables of contents for every GitHub README file.
Update Aug. 2021: GitHub can create automagically table of content of your wiki! See my edited answer below. – VonC Aug 19 '21 at 21:37 GitHub now automatically generates a table of content for Wikis based on the headings.
According to this post, all you have to do is add {:toc}
in your markdown page at the place you want a table of contents.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With