{"action":"created","issue":{"url":"https://api.github.com/repos/Python-Markdown/markdown/issues/637","repository_url":"https://api.github.com/repos/Python-Markdown/markdown","labels_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/637/comments","events_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/637/events","html_url":"https://github.com/Python-Markdown/markdown/issues/637","id":297558049,"node_id":"MDU6SXNzdWUyOTc1NTgwNDk=","number":637,"title":"Limit the TOC level depth in extensions/toc","user":{"login":"the9000","id":245450,"node_id":"MDQ6VXNlcjI0NTQ1MA==","avatar_url":"https://avatars2.githubusercontent.com/u/245450?v=4","gravatar_id":"","url":"https://api.github.com/users/the9000","html_url":"https://github.com/the9000","followers_url":"https://api.github.com/users/the9000/followers","following_url":"https://api.github.com/users/the9000/following{/other_user}","gists_url":"https://api.github.com/users/the9000/gists{/gist_id}","starred_url":"https://api.github.com/users/the9000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the9000/subscriptions","organizations_url":"https://api.github.com/users/the9000/orgs","repos_url":"https://api.github.com/users/the9000/repos","events_url":"https://api.github.com/users/the9000/events{/privacy}","received_events_url":"https://api.github.com/users/the9000/received_events","type":"User","site_admin":false},"labels":[{"id":97230,"node_id":"MDU6TGFiZWw5NzIzMA==","url":"https://api.github.com/repos/Python-Markdown/markdown/labels/extension","name":"extension","color":"444444","default":false},{"id":97226,"node_id":"MDU6TGFiZWw5NzIyNg==","url":"https://api.github.com/repos/Python-Markdown/markdown/labels/feature","name":"feature","color":"d7e102","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-02-15T18:56:08Z","updated_at":"2018-07-26T15:55:41Z","closed_at":"2018-07-25T18:43:10Z","author_association":"NONE","body":"####  Use case\r\nTake a document, such as an API description, or a document converted from Org mode, with lots of deep-level headers and very short texts under each of them.\r\nA TOC of such a document becomes excessively long and detailed. (My particular case is what mkdocs generates.)\r\n\r\n#### A fix\r\n* Add a config parameter that optionally limits the maximum level of headers included in the TOC.\r\n* Filter the levels [where they are generated](https://github.com/Python-Markdown/markdown/blob/master/markdown/extensions/toc.py#L242;) according to that parameter.\r\n\r\n I'll gladly make a PR, but would appreciate any advice on the best way to add a config parameter."},"comment":{"url":"https://api.github.com/repos/Python-Markdown/markdown/issues/comments/408145844","html_url":"https://github.com/Python-Markdown/markdown/issues/637#issuecomment-408145844","issue_url":"https://api.github.com/repos/Python-Markdown/markdown/issues/637","id":408145844,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODE0NTg0NA==","user":{"login":"RoyiAvital","id":7347975,"node_id":"MDQ6VXNlcjczNDc5NzU=","avatar_url":"https://avatars1.githubusercontent.com/u/7347975?v=4","gravatar_id":"","url":"https://api.github.com/users/RoyiAvital","html_url":"https://github.com/RoyiAvital","followers_url":"https://api.github.com/users/RoyiAvital/followers","following_url":"https://api.github.com/users/RoyiAvital/following{/other_user}","gists_url":"https://api.github.com/users/RoyiAvital/gists{/gist_id}","starred_url":"https://api.github.com/users/RoyiAvital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoyiAvital/subscriptions","organizations_url":"https://api.github.com/users/RoyiAvital/orgs","repos_url":"https://api.github.com/users/RoyiAvital/repos","events_url":"https://api.github.com/users/RoyiAvital/events{/privacy}","received_events_url":"https://api.github.com/users/RoyiAvital/received_events","type":"User","site_admin":false},"created_at":"2018-07-26T15:55:41Z","updated_at":"2018-07-26T15:55:41Z","author_association":"NONE","body":"@waylan , What about the option to set the first level to be included?\r\n\r\nTo make it more clear, I want the TOC to include only `<h2>` to `<h4>` (Where `<h2>` is the highest level)."}}
{"actor":{"display_login":"RoyiAvital"}}