To use add a table of contents using kramdown on your Jekyll blog, add the follow to your file where you are want your table of contents. Write your documentation using h3 headers for each function inside a code block. Structure your comments using headers. My document had three levels of headings, so I went up to ####. For Google products, with your document opened, click File-> Publish to the web. Created with โ™ฅ by Justin James. As of now, Gitlab Cloud Markdown uses GFM as well, or at least the version of Gitlab Cloud that I tested this on does. The [ [_TOC_]] can be placed anywhere in the page to render the table of contents. Markdown extensions. Here’s what I did. You can add Markdown formatting elements to a plaintext file using a text editor application. The more headings your document has, the worse it gets. - markdown-toc_repeated-headings.md Here’s what it looked like in StackEdit after I had all the inline links set up: Not bad! There are already a number of scripts etc doing this, but I failed to find one that suited my needs. You will see the target URL for the header item’s link: If you click the little link icon, the browser will reload. Section Headers. Jekyll Kramdown TOC Sample Showing All Headers. I still wanted to show the headings in hierarchy instead of a flat list, though. When you are writing tutorials that are broken up by sections it is nice to have a table of contents at the top to help the users navigate. markdown-toc is a small application written in Go that helps you generate a Table of Contents (ToC) for your Markdown file. It allows you to have a cleaner implementation and reusability. It benefits long-form content because it shows the user a handy overview of what content there is with a convenient way to get there. Here’s what that looked like in StackEdit: When I published the StackEdit file to a GitHub README, the same content looked like this: After I published my Markdown file to GitHub, I was ready to manually add a table of contents. But one downside is that, you need to put this shortcode in every markdown file to render the table of contents inside them. Syntax highlighting to code blocks in markdown files using PrismJS. Here is a small example: Markdown Table of Contents Generator. I'm a technical writer and editor. The syntax is easy to remember; that is probably why I prefer it. 2. All content is the property of Justin James and digitaldrummerj.me. Requires markdown.toc to be true. I didn’t find a step-by-step guide, so I patched together one way to do it from various Markdown cheatsheets and StackOverflow posts. Specifying Location of the Table of Contents, Changing the Title to the Table of Contents, Solved: Windows 10 Errors When Trying to Watch Video with HEVC Extension Not Found, Stop The Zoom Trolls and Prevent Zoombombing, Git: Clone Branch to New Repo without History, Which RxJS Operators to use in your NgRx Effects, Copy the pre-commit.sample to pre-commit with no file extension, Add your doctoc command to the file and save, Now the next time you do a git commit the table of contents will automatically updated. To change use the following: UPDATED 2016-05-10: For Jekyll the recommendation is now to use the kramdown table of contents built-in generator. You will see something similar to the following menu items: Table of contents. Hugo supports table of contents with AsciiDoc content format. By default doctoc will add the table of contents at the top of the file. In conclusion. Note that Gitlab’s docs here reveal that until recently Gitlab used Kramdown under the hood (see below). If you are not running it in the directory that contains your markdown files that you want a table of contents on then make sure to update the source variable. For example, here's what Google sheets will look like: Choose Embed, check your settings, click on Publish and copy the