{"action":"created","issue":{"url":"https://api.github.com/repos/isaacs/github/issues/215","labels_url":"https://api.github.com/repos/isaacs/github/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/isaacs/github/issues/215/comments","events_url":"https://api.github.com/repos/isaacs/github/issues/215/events","html_url":"https://github.com/isaacs/github/issues/215","id":36227252,"number":215,"title":"Insert automatically generated table of contents TOC on rendered markdown files like README.md.","user":{"login":"cirosantilli","id":1429315,"avatar_url":"https://avatars.githubusercontent.com/u/1429315?v=3","gravatar_id":"","url":"https://api.github.com/users/cirosantilli","html_url":"https://github.com/cirosantilli","followers_url":"https://api.github.com/users/cirosantilli/followers","following_url":"https://api.github.com/users/cirosantilli/following{/other_user}","gists_url":"https://api.github.com/users/cirosantilli/gists{/gist_id}","starred_url":"https://api.github.com/users/cirosantilli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cirosantilli/subscriptions","organizations_url":"https://api.github.com/users/cirosantilli/orgs","repos_url":"https://api.github.com/users/cirosantilli/repos","events_url":"https://api.github.com/users/cirosantilli/events{/privacy}","received_events_url":"https://api.github.com/users/cirosantilli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":236,"created_at":"2014-06-21T16:34:27Z","updated_at":"2016-01-13T06:07:09Z","closed_at":null,"body":"When I see a manually generated table of contents, it makes me sad.\r\n\r\nWhen I see a huge README that is impossible to navigate without it, it makes me even sadder.\r\n\r\nLaTeX has it. Gollum has it. Pandoc has it. So why not GFM?\r\n\r\nThere are some tools that automate the generation, but they're just an ugly hack:\r\n\r\n- require a Make before pushes\r\n- add output to version control\r\n- modify our dear source code for us\r\n\r\nNow the bitter part: what syntax to use?\r\n\r\nWhatever is chosen, it should be a standard way to extend Markdown, so that other extensions can be added later on.\r\n\r\nOne possibility is to use Kramdown extension syntax and insert the TOC with `{:toc max_level=3 }`.\r\n\r\nRedcarpet already has a command that generates the TOC: `Redcarpet::Render::HTML_TOC`, but no way to insert it, and no standard way to extend markdown.\r\n\r\nSame for GitLab: http://feedback.gitlab.com/forums/176466-general/suggestions/5790538-extension-for-inserting-a-table-of-contents-toc\r\n\r\nStackOverflow: 66 upvotes as of 2014-06: http://stackoverflow.com/questions/9721944/automatic-toc-in-github-flavoured-markdown\r\n\r\n---\r\n\r\n[Steven! Ragnarök](https://github.com/nuclearsandwich) replied with the neutral:\r\n\r\n> Thanks for the suggestion and links. I'll add it to our internal feature request list for the team to see."},"comment":{"url":"https://api.github.com/repos/isaacs/github/issues/comments/171179790","html_url":"https://github.com/isaacs/github/issues/215#issuecomment-171179790","issue_url":"https://api.github.com/repos/isaacs/github/issues/215","id":171179790,"user":{"login":"calvinxiao","id":929238,"avatar_url":"https://avatars.githubusercontent.com/u/929238?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinxiao","html_url":"https://github.com/calvinxiao","followers_url":"https://api.github.com/users/calvinxiao/followers","following_url":"https://api.github.com/users/calvinxiao/following{/other_user}","gists_url":"https://api.github.com/users/calvinxiao/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinxiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinxiao/subscriptions","organizations_url":"https://api.github.com/users/calvinxiao/orgs","repos_url":"https://api.github.com/users/calvinxiao/repos","events_url":"https://api.github.com/users/calvinxiao/events{/privacy}","received_events_url":"https://api.github.com/users/calvinxiao/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T06:07:09Z","updated_at":"2016-01-13T06:07:09Z","body":"Guys there is Google Chrome extention that can solve this problem for me. [https://chrome.google.com/webstore/detail/github-toc/nalkpgbfaadkpckoadhlkihofnbhfhek](https://chrome.google.com/webstore/detail/github-toc/nalkpgbfaadkpckoadhlkihofnbhfhek)"}}