{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/issues/37","repository_url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc","labels_url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/issues/37/comments","events_url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/issues/37/events","html_url":"https://github.com/asciidoctor/jekyll-asciidoc/issues/37","id":122050382,"number":37,"title":"Sidebar table of contents in Jekyll","user":{"login":"TomSwan","id":7075671,"avatar_url":"https://avatars.githubusercontent.com/u/7075671?v=3","gravatar_id":"","url":"https://api.github.com/users/TomSwan","html_url":"https://github.com/TomSwan","followers_url":"https://api.github.com/users/TomSwan/followers","following_url":"https://api.github.com/users/TomSwan/following{/other_user}","gists_url":"https://api.github.com/users/TomSwan/gists{/gist_id}","starred_url":"https://api.github.com/users/TomSwan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomSwan/subscriptions","organizations_url":"https://api.github.com/users/TomSwan/orgs","repos_url":"https://api.github.com/users/TomSwan/repos","events_url":"https://api.github.com/users/TomSwan/events{/privacy}","received_events_url":"https://api.github.com/users/TomSwan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"assignees":[{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/milestones/8","html_url":"https://github.com/asciidoctor/jekyll-asciidoc/milestones/v2.1.0","labels_url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/milestones/8/labels","id":1859143,"number":8,"title":"v2.1.0","description":"","creator":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-07-01T08:11:59Z","updated_at":"2016-07-01T08:12:10Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2015-12-14T14:12:54Z","updated_at":"2016-07-03T01:52:16Z","closed_at":null,"body":"When processed by Jekyll, `:toc: left` and `:toc: right` directives do not position tables of content in a sidebar as when the same document is processed by the stand-alone asciidoctor.  "},"comment":{"url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/issues/comments/230130775","html_url":"https://github.com/asciidoctor/jekyll-asciidoc/issues/37#issuecomment-230130775","issue_url":"https://api.github.com/repos/asciidoctor/jekyll-asciidoc/issues/37","id":230130775,"user":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"created_at":"2016-07-03T01:52:15Z","updated_at":"2016-07-03T01:52:15Z","body":"We actually have a choice between a liquid filter and a liquid tag.\r\n\r\nHere's how it would look as a filter:\r\n\r\n```\r\n{{ page.document | tocify_asciidoc }}\r\n```\r\n\r\nand with an explicit number of levels:\r\n\r\n```\r\n{{ page.document | tocify_asciidoc: 3 }}\r\n```\r\n\r\n(we may consider asciidoc_tocify as an alternate name)\r\n\r\nHere's how it would look as a tag:\r\n\r\n```\r\n{% asciidoc_toc %}\r\n```\r\n\r\nand with an explicit number of levels:\r\n\r\n```\r\n{% asciidoc_toc 3 %}\r\n```\r\n\r\nI prefer the filter for a few reasons. First, it keeps the door open to use it on an auxiliary document. Second, filters have better support for arguments, whereas we have to parse the arguments supplied to a tag. Finally, with the parsed document available as `page.document`, it opens the door to other document transforms written as filters or using the object in a more capable template languages like Slim.\r\n\r\nI only plan to output the toc starting at the outer `<ul>`. This gives maximum flexibility to the template author to arrange it as desired. It's even possible to check for an empty table of contents using the capture tag.\r\n\r\n```\r\n{% if page.document %}\r\n{% capture toc %}{{ page.document | tocify_asciidoc }}{% endcapture %}{% if toc != '' %}<div class=\"toc\">\r\n{{ toc }}\r\n</div>{% endif %}\r\n{% endif %}\r\n```"}}
{"actor":{"display_login":"mojavelinux"}}