{"action":"created","issue":{"url":"https://api.github.com/repos/fletcher/MultiMarkdown-5/issues/23","repository_url":"https://api.github.com/repos/fletcher/MultiMarkdown-5","labels_url":"https://api.github.com/repos/fletcher/MultiMarkdown-5/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/fletcher/MultiMarkdown-5/issues/23/comments","events_url":"https://api.github.com/repos/fletcher/MultiMarkdown-5/issues/23/events","html_url":"https://github.com/fletcher/MultiMarkdown-5/issues/23","id":145884645,"number":23,"title":"{{TOC}} in individual file and File transclusion will render all of them","user":{"login":"ickc","id":10970208,"avatar_url":"https://avatars.githubusercontent.com/u/10970208?v=3","gravatar_id":"","url":"https://api.github.com/users/ickc","html_url":"https://github.com/ickc","followers_url":"https://api.github.com/users/ickc/followers","following_url":"https://api.github.com/users/ickc/following{/other_user}","gists_url":"https://api.github.com/users/ickc/gists{/gist_id}","starred_url":"https://api.github.com/users/ickc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ickc/subscriptions","organizations_url":"https://api.github.com/users/ickc/orgs","repos_url":"https://api.github.com/users/ickc/repos","events_url":"https://api.github.com/users/ickc/events{/privacy}","received_events_url":"https://api.github.com/users/ickc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-05T04:33:31Z","updated_at":"2016-04-12T00:33:56Z","closed_at":null,"body":"Because of how `{{TOC}}` is treated, putting it in each individual files will result in multiple TOC in the master file. I'm not sure if there's any workaround by pure MultiMarkdown, if a TOC is required for each files---individual or the master that includes them.\r\n\r\nA suggestion is to add an alternative way to add a TOC: by metadata front matter. Put there, file transclusion will exclude it. This loses the flexibility to the location and the title of TOC. For the location, the old syntax can be used if file transclusion is not needed. For the title, a syntax like this in the metadata front matter block:\r\n\r\n```yaml\r\ntoc: true\r\ntoc-title: Fancy TOC Title\r\n```\r\n\r\ncould work.\r\n\r\nThe 2 names are directly borrowed from [Pandoc - Pandoc User’s Guide](http://pandoc.org/README.html#variables-set-by-pandoc)."},"comment":{"url":"https://api.github.com/repos/fletcher/MultiMarkdown-5/issues/comments/208640621","html_url":"https://github.com/fletcher/MultiMarkdown-5/issues/23#issuecomment-208640621","issue_url":"https://api.github.com/repos/fletcher/MultiMarkdown-5/issues/23","id":208640621,"user":{"login":"fletcher","id":97321,"avatar_url":"https://avatars.githubusercontent.com/u/97321?v=3","gravatar_id":"","url":"https://api.github.com/users/fletcher","html_url":"https://github.com/fletcher","followers_url":"https://api.github.com/users/fletcher/followers","following_url":"https://api.github.com/users/fletcher/following{/other_user}","gists_url":"https://api.github.com/users/fletcher/gists{/gist_id}","starred_url":"https://api.github.com/users/fletcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fletcher/subscriptions","organizations_url":"https://api.github.com/users/fletcher/orgs","repos_url":"https://api.github.com/users/fletcher/repos","events_url":"https://api.github.com/users/fletcher/events{/privacy}","received_events_url":"https://api.github.com/users/fletcher/received_events","type":"User","site_admin":false},"created_at":"2016-04-12T00:33:56Z","updated_at":"2016-04-12T00:33:56Z","body":"The problem is that it's not clear where the TOC should be placed.  That's why I use the `{{TOC}}` approach instead of metadata.\r\n\r\nYou could have the TOC command itself in a transcluded file, and then use different transclude base folders for the master vs child files.  This isn't a great workaround, but it should work if done properly.\r\n\r\nI'll think about other approaches for the future as well."}}